i want to select 1 row with 2 items from listbox to use them in method
here i add 2 items in 1 row
Uniqueslist.Items.Add(string.Format("{0} , {1}", MobIDTextUnq.Text, MobCntTextUnq.Text));
and i want to use this 2 items in this method
public static void Loadmonster(int MobID,int Cont)
{
DateTime time = System.DateTime.Now;
time.ToLongTimeString();
try
{
Packet packet = new Packet((ushort)Opcode.CLIENT_OPCODES.CLIENT_GM, true);
packet.WriteUInt8((byte)6);
packet.WriteUInt8((byte)0);
packet.WriteUInt32(MobID);
packet.WriteUInt8(Cont);
packet.WriteUInt8((byte)3);
Agent.Send(packet);
CodeWindow.Logs.Items.Add("[" + time + "] : Loadmonster Done.");
}
}
i think it's by loop but i don't know how to do this and i want if this like exmple 1 row selected never select it again and select the next row and never back again i hope someone help me with this problem .
[1]: http://i.stack.imgur.com/sjKgt.png
What I have tried:
but it's give me error under .Split
var jointString = UnqEventWindow.Uniqueslist.Items[0];
var sections = jointString.Split(',');
int mobId = int.Parse(sections[0].Trim());
int count = int.Parse(sections[1].Trim());
Codes.Loadmonster(mobId, count);