How to get control's class name?

  • Thread starter Thread starter Thonglao Rud
  • Start date Start date
T

Thonglao Rud

Hi everybody!

(Sorry my poor English)
My question: how to get "full" class name of controls. For example, "WindowsForm10.BUTTON.app3a" instead "System.Windows.Forms.Button"

Thanks in advance.
 
Thonglao Rud said:
Hi everybody!

(Sorry my poor English)
My question: how to get "full" class name of controls. For example,
"WindowsForm10.BUTTON.app3a" instead "System.Windows.Forms.Button"

When you've got a reference to the control, call GetType() on it - then
there are things like the Type.FullName property available to you.
 
...
My question: how to get "full" class name of controls.
For example, "WindowsForm10.BUTTON.app3a" instead
"System.Windows.Forms.Button"

My guess is that you have a variable app3a which references to a Control.
Then you can use the following to get the full name of the class.

string fullname = app3a.GetType().FullName;

// Bjorn A
 
My question: how to get "full" class name of controls. For example, "WindowsForm10.BUTTON.app3a" instead "System.Windows.Forms.Button"

Sounds like you want to use the GetClassName API

[DllImport("user32.dll", CharSet=CharSet.Auto")]
static extern int GetClassName(IntPtr hwnd, StringBuilder lpClassName,
int nMaxCount);



Mattias
 
Mattias said:
Sounds like you want to use the GetClassName API

NO and YES :)
I've tried to port some old fasion code from Delphi to C#. I need pure .NET code.

Thank you all for fast reply!
 

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

Back
Top