散分:c#(300分)

this 代表建立的窗口吧。
 
没有用Delphi写过.net的东东,不知道,帮你UP
 
this 如果在 delphi 中,相当于 main form 的name
 
在Delphi.Net中
type
TForm1 = class (TForm)
Edit1: TEdit;
Button1: TButton;
protected
procedure Button1Click(Sender: TObject;
Args: TEventArgs);
public
constructor Create;
end;
{...}
procedure TForm1.Button1Click(Sender: TObject;
Args: TEventArgs);
begin
MessageBox.Show('您输入的是'#$A#$D + Edit1.Text , '测试');
end;

constructor TForm1.Create;
begin
{...}
with Button1do
begin
Name := 'Button1';
Top := 10;
Left := 130;
Width := 70;
Height := 28;
Text := 'Show!';
add_Click( Button1Click );
//增加事件
end;

{...}
end;
 
ojkuuuuuppppppppp
 
领分的来了。+[:D]
 
问题我现在不会,祝楼主新年快乐,我现在一无所有了,给点分,行不?[:)][:)]
 
消息出来
 
在VF中 this 代表本身。
 
up,这是个事件委托模式,和delphili的button1.onclick:=myclick;差不多,
只不过delphi给隐藏了
 
C++Builder是可以这样实现的
mybn->OnMouseUp=MyMouseUp;
MyMouseUp的写法如下
void __fastcall TMainForm::MyMouseUp(TObject *Sender,TMouseButton Button, TShiftState Shift, int X, int Y)
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
顶部