Xcelled194 28 Junior Poster in Training

Best solution would be to edit the App Manifest on Application TAb of the project properties. Set the requestedExececutionLevel to requireAdministrator

Xcelled194 28 Junior Poster in Training

Could you use Panels? If not, try creating your own custom control. You can set its shape with the Region property.

Xcelled194 28 Junior Poster in Training

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

ddanbe commented: Excellent advice. +14
Xcelled194 28 Junior Poster in Training

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:

  • Because C# 3.5 and below doesn't support optional parameters, you must supply an argument for every parameter.
  • For the xPos and yPos, passing in -1 will center the form in the corresponding direction. (x is horizontal, y is vertical)
  • There is almost nothing in the way of error trapping, because I feel that you, the end programmer, can best trap the errors as suited to your project. Simply surrounding InputBox.Show() with a try statement should prove adequate.
  • If the user presses cancel, InputBox.Show() returns an empty string ("")
  • If you modify/distribute the source code, please retain my information comment, however you may add yourself as an author.
  • PM me with any features you think this should have or any bugs you find.
ddanbe commented: Good. +14