I got a problem that I haven't found a solution for, and are hoping to get some help.
I have the following piece of code (with commented out parts that I tried without success)
Hoping someone can help me.
Expand|Select|Wrap|Line Numbers
- else if (msg[0].ToString() == "set")
- {
- MessageBox.Show(msg[0].ToString());
- if (msg[1].ToString() == "master")
- {
- MessageBox.Show(msg[1].ToString());
- int num;
- if (Int32.TryParse(msg[2], out num))
- {
- int NMasters = MasterBox.Items.Count;
- MessageBox.Show(NMasters.ToString());
- if (num < 1)
- {
- Client.Self.InstantMessage(e.IM.FromAgentID, "[ERROR]: Invalid number (lower than NMasters), please try again!");
- }
- else if (num > NMasters)
- {
- Client.Self.InstantMessage(e.IM.FromAgentID, "[ERROR]: Invalid number (Higher than NMasters), please try again!");
- }
- else
- {
- MessageBox.Show("MEH");
- MasterBox.Select(num, num);
- //MasterBox.DroppedDown = true;
- //MasterBox.SelectedItem = num;
- //MasterBox.DroppedDown = false;
- //MasterName = MasterBox.SelectedItem.ToString();
- //GetMKey();
- }
- }
- }
- }
The command "set master X" is supposed to change the selected item inside the combobox, but whatever I try won't work.
Is it possible at all to do it the way I am trying to? Or do I have to re-think it all?
I am not too good (yet) with Csharp, so hopefully someone can point me in the right direction.
Thank you all!