procedure test()
var
t: ttreeview;
begin
t:=ttreeview.Create(nil);
t.Items.Add(nil, 'asdf');
t.Free;
end;下面是错误信息:
---------------------------
Debugger Exception Notification
---------------------------
Project DOR.exe raised exception class EInvalidOperation with message 'Control '' has no parent window'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------可我真的没有parent window给它,怎么办。
var
t: ttreeview;
begin
t:=ttreeview.Create(nil);
t.Items.Add(nil, 'asdf');
t.Free;
end;下面是错误信息:
---------------------------
Debugger Exception Notification
---------------------------
Project DOR.exe raised exception class EInvalidOperation with message 'Control '' has no parent window'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------可我真的没有parent window给它,怎么办。
var
t: ttreeview;
begin
t:=ttreeview.Create(nil);
t.parent := form1;
t.Items.Add(nil, 'asdf');
t.Free;
end;
procedure test();
var
t: ttreeview;
begin
t:=ttreeview.Create(nil);
t.Parent := Application.MainForm;
t.Items.Add(nil, 'asdf');
t.Free;
end;
parent赋值该临时FORM
不要显示它就得了
t.Parent := Handleprocedure TMarqueePanel.WndProc(var Msg: TMessage);
begin
Result := DefWindowProc(Handle, Msg, wParam, lParam);
end;
估计你们俩个连我那段代码什么意思都没看懂,或者根本就是没看,我什么时候在继承对象了?!至少其它人说的,也就是再创建个窗体给它,不是说这方法不可以,但实在太笨,我正因为不想这么做所以才来这问的,不要当我是傻瓜以为我想不到这方法。这里唯一帮助我的是schmodock(愚人码头) ,兄弟,谢谢你的方法,尽管你的三角最少。