🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.winforms.controls.using
10 messages
10 total messages Started by Jesse Calato Mon, 02 Oct 2006 20:20
vcl .net components in winforms
#19
Author: Jesse Calato
Date: Mon, 02 Oct 2006 20:20
2 lines
829 bytes
Is it possible to use vcl .net components in WinForms?
Re: vcl .net components in winforms
#20
Author: Marc Rohloff TeamB
Date: Mon, 02 Oct 2006 22:50
8 lines
1282 bytes
On 2 Oct 2006 13:20:23 -0700, Jesse Calato wrote:

> Is it possible to use vcl .net components in WinForms?
Please don't multipost.

-- 
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com
Re: vcl .net components in winforms
#21
Author: Jesse Calato
Date: Tue, 03 Oct 2006 20:59
5 lines
1133 bytes
>> Is it possible to use vcl .net components in WinForms?
>Please don't multipost.

Sorry about the multipost.  Is it possible?
Re: vcl .net components in winforms
#22
Author: Arie Zilberstein
Date: Wed, 04 Oct 2006 10:48
19 lines
1689 bytes
Hi,

Yes, it's possible, but with a good amount of hair-pulling.
The first thing you need to do is set your VCL.NET control's ParentWindow 
property to the Handle property of the containing WinForm.
The rest involves various workarounds to make it look smooth. For example, 
some events of the WinForm have to be handled and "delegated" to the VCL.NET 
control, e.g. the Resize and others.

Regards,
Arie

"Jesse Calato" <jcalato@harriscomputer.com> wrote in message 
news:4522cf38$1@newsgroups.borland.com...
>
>>> Is it possible to use vcl .net components in WinForms?
>>Please don't multipost.
>
> Sorry about the multipost.  Is it possible? 
Re: vcl .net components in winforms
#27
Author: Jesse Calato
Date: Thu, 05 Oct 2006 16:07
11 lines
1320 bytes
>The first thing you need to do is set your VCL.NET control's >ParentWindow 
>property to the Handle property of the containing WinForm.

The ParentWindow Property is an HWND, and the Handle Property 
is an IntPtr getting an incompatible types error on compilation.
How do I get around this?

Do you have an example that you could post?

Thank you in advance.
Re: vcl .net components in winforms
#28
Author: Jesse Calato
Date: Thu, 05 Oct 2006 17:02
9 lines
1262 bytes
>The rest involves various workarounds to make it look smooth. For example, 
>some events of the WinForm have to be handled and "delegated" to the VCL.NET 
>control, e.g. the Resize and others.

I have a VCL button displaying on a WinForm.  How do 
I "delegate" the click event to VCL.NET?

Thanks again.
Re: vcl .net components in winforms
#29
Author: Jesse Calato
Date: Thu, 05 Oct 2006 17:03
15 lines
1515 bytes
"Jesse Calato" <jcalato@harriscomputer.com> wrote:
>
>>The first thing you need to do is set your VCL.NET control's >ParentWindow 
>>property to the Handle property of the containing WinForm.
>
>The ParentWindow Property is an HWND, and the Handle Property 
>is an IntPtr getting an incompatible types error on compilation.
>How do I get around this?
>
>Do you have an example that you could post?
>
>Thank you in advance.

I figured this out ... Thank You
Re: vcl .net components in winforms
#30
Author: Marc Rohloff TeamB
Date: Fri, 06 Oct 2006 22:18
11 lines
1526 bytes
On 5 Oct 2006 10:02:05 -0700, Jesse Calato wrote:

> I have a VCL button displaying on a WinForm.  How do 
> I "delegate" the click event to VCL.NET?

Just create an event handler and assign it (using := instead of
include)

-- 
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com
Re: vcl .net components in winforms
#31
Author: Arie Zilberstein
Date: Mon, 09 Oct 2006 09:08
37 lines
2184 bytes
Hi,

This should be no problem, the usual method of assigning an error handler 
will work with the TButton.

That is, create a procedure whose signature is this:

procedure Button1Click(Sender: TObject);

and assign it to the button like this:

Button1.OnClick := Button1Click;

Sometimes you require delegations when you have WinForm controls that act as 
containers for VCL.NET controls. For example, if you want the online-help 
(F1) to work, you have to handle HelpRequest in the parent WinForm control 
(or better, override OnHelpRequested), and there you should invoke something 
like Forms.Application.HelpCommand(HELP_CONTEXT, 
InternalControl.HelpContext);

Best regards,
Arie



"Jesse Calato" <jcalato@harriscomputer.com> wrote in message 
news:45253a8d$1@newsgroups.borland.com...
>
>>The rest involves various workarounds to make it look smooth. For example,
>>some events of the WinForm have to be handled and "delegated" to the 
>>VCL.NET
>>control, e.g. the Resize and others.
>
> I have a VCL button displaying on a WinForm.  How do
> I "delegate" the click event to VCL.NET?
>
> Thanks again. 
Re: vcl .net components in winforms
#37
Author: shaun.dodimead
Date: Mon, 04 Dec 2006 17:07
12 lines
1843 bytes
Hi,

I have a similar problem to this. I've got it working using the handle
assignment, but if i dispose of my tform, and the handling form etc,
and then try to do it again (i.e. recreate the windows forms panel,
create a new tform instance, bind the handle to the new win forms
panel) when i call the tform.show() method, i get 'Invalid Window
Handle'.

It works the first, time just not any subsequent times! Any thoughts?

Shaun
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads