question

yanpeng avatar image
0 Votes"
yanpeng asked yanpeng commented

How does the Control create a handle in general?

When I debug the OnHandleCreated function which inherits from Control, I find that Handle has a non-null value, so I know that the OnHandleCreated method is a method that call the event handler of HandleCreated. But how the Control create its handle?

windows-forms
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Best to show us what you have currently to advise you.

0 Votes 0 ·
yanpeng avatar image yanpeng karenpayneoregon ·

Yeah, that title and description are unclear. I changed them.

0 Votes 0 ·

1 Answer

Castorix31 avatar image
0 Votes"
Castorix31 answered yanpeng commented

But how the Control create its handle?

Like for all Win32 windows, with CreateWindowEx, mainly in CreateHandle function from NativeWindow.cs



· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

thanks. I get it.

0 Votes 0 ·