The following code shows you how to access control panel items through coding. Adding all commands to listbox then selecting it and press button to view it.
using Shell32;
public void Form1_Load(System.Object sender, System.EventArgs e)
{
ListBox1.Items.Add("appwiz.cpl"); //for opening install/uninstall program
ListBox1.Items.Add("desk.cpl"); //for opening desktop properties
ListBox1.Items.Add("hdwwiz.cpl"); //for opening device manager
ListBox1.Items.Add("intl.cpl"); //for opening region and language properties
ListBox1.Items.Add("inetcpl.cpl"); //for opening internet properties
}
public void Button1_Click(System.Object sender, System.EventArgs e)
{
Shell objShell = new Shell();
objShell.ControlPanelItem(ListBox1.SelectedItem.ToString());
}
1 comments:
It works perfectly.
But I wasn't knowing that I must add Shell32.dll to "references".
Thanks.Good work.
-ZAMMA
Post a Comment