How to change the classname???
-
I create a winform by c# 2003. The form's classname like "windows.forms.app3",I must change the it to the particular name that like "myForm". Thanks for you help.
If you use F2 to rename the file in the solution Explorer, I think it will rename the class for you. Yo ucan also right click on the name and rename it via the refactor menu. Finally, you can just do a global search and replace.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
If you use F2 to rename the file in the solution Explorer, I think it will rename the class for you. Yo ucan also right click on the name and rename it via the refactor menu. Finally, you can just do a global search and replace.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Sorry, maybe my question is not clear. The classname is not my class name. use the tools SPY++, you can find the form's classname is "windows.forms.app3". i want change it.
well, why on earth would you want to do that ? I doubt you can.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
If you use F2 to rename the file in the solution Explorer, I think it will rename the class for you. Yo ucan also right click on the name and rename it via the refactor menu. Finally, you can just do a global search and replace.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Christian Graus wrote:
If you use F2 to rename the file in the solution Explorer, I think it will rename the class for you. Yo ucan also right click on the name and rename it via the refactor menu. Finally, you can just do a global search and replace.
Only works on a "modern" IDE. VS 2003 didn't have the fancy refactoring - this was introduced in 2005.
Deja View - the feeling that you've seen this post before.
-
well, why on earth would you want to do that ? I doubt you can.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
Christian Graus wrote:
If you use F2 to rename the file in the solution Explorer, I think it will rename the class for you. Yo ucan also right click on the name and rename it via the refactor menu. Finally, you can just do a global search and replace.
Only works on a "modern" IDE. VS 2003 didn't have the fancy refactoring - this was introduced in 2005.
Deja View - the feeling that you've seen this post before.
Which is why I also said 'search and replace' :p
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
My winform is controled by other software. It use windows api function "sendmessage" send the windows message to my form. The function need 2 parms "form's classname & form's title". so i must change the classname to specific name like "myForm".
No, you don't need to do that. SendMessage takes a HWND, you can FIND the hwnd based on name or title, using different APIs.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
I create a winform by c# 2003. The form's classname like "windows.forms.app3",I must change the it to the particular name that like "myForm". Thanks for you help.
Override CreateParams, and set the class name yourself. Not sure if it will give you an exact name though, but it's worth a try.
-
Override CreateParams, and set the class name yourself. Not sure if it will give you an exact name though, but it's worth a try.
-
-
If you want to use SendMessage to send something to a window, do what was mentioned above. Maybe inherit a NativeWindow, and set the caption to something like "My Special Window". Then you can use FindWindow("My Special Window") to find the handle of the window you want to SendMessage to. All you need to do then is override WndProc in the NativeWindow. Have a look at FindWindow on pinvoke.net.