Best solution would be to edit the App Manifest on Application TAb of the project properties. Set the requestedExececutionLevel to requireAdministrator
ddanbe commented: Excellent advice. +14
Best solution would be to edit the App Manifest on Application TAb of the project properties. Set the requestedExececutionLevel to requireAdministrator
Could you use Panels? If not, try creating your own custom control. You can set its shape with the Region property.
This sounds like a job for reflection. Unfortunately, my experience with reflection is limited, so I suggest googling "C# Reflection Method Name".
EDIT: quick google search, this looks exactly like what you want: http://en.csharp-online.net/CSharp_FAQ:_How_call_a_method_using_a_name_string
One of the things that always irked me about C# is its lack of an InputBox function. In VB, You can simply do
response = InputBox("Enter your name")
Unfortunately, there is no C# equivalent. Sure, you can call the VB one, but doesn't that kind of defeat the purpose of C#? So, like any good programmer, I set out to make my own pure C# InputBox. Its fairly bare bones, but it gives all the functionality of the VB InputBox.
You can use it by including the InputBox class in your program's namespace and calling it like this:
string lang = InputBox.Show("What's your favorite language?", "Language", "C#", -1, -1);
Notes: