Setting the "ClassName" of a .Net Form

G

Guest

Hi. If I do a Win32 GetClassName() on the handle of one of my Form objects, I
get something like "WindowsForms10.Window.8.app3". Is there any way for me to
set, either at design-time or run-time, the ClassName of my form so that it's
something more meaningful than this?

Also, how does are these ClassName strings generated and do there dot
notations have any meaning?

Thanks.

Alex
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Hi Alex,

Windows Forms framework uses bunch of window classes for different type of
controls. Thus all the control of the same type share the same window class.
Because to object orientation is moved from Windows OS to the framework you
don't have to care what is the actual window class. I know it's a drag when
one uses tools like Spy++, but is is not possible to just change the class
name.
Anyways you can change the window class by overriding CreateParams property,
but bare in mind that you can't just change the name you have to provide
name of registered window class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top