| Mirage Source http://www.miragesource.net/forums/ |
|
| OMFG I AM GNA EXPLODE http://www.miragesource.net/forums/viewtopic.php?f=201&t=2032 |
Page 1 of 1 |
| Author: | Coke [ Tue Jun 12, 2007 2:45 am ] |
| Post subject: | OMFG I AM GNA EXPLODE |
Read my third post. |
|
| Author: | Coke [ Tue Jun 12, 2007 2:55 am ] |
| Post subject: | Re: OMFG I AM GNA EXPLODE |
Combobox* |
|
| Author: | Xlithan [ Tue Jun 12, 2007 3:01 am ] |
| Post subject: | Re: OMFG I AM GNA EXPLODE |
Code: Dim i As Integer For i = 0 To List1.ListCount List2.AddItem List1.List(i) Next i Same for combo box as well as listbox |
|
| Author: | Coke [ Tue Jun 12, 2007 3:13 am ] |
| Post subject: | Re: OMFG I AM GNA EXPLODE |
Argh basicaly i have an opt control that says private message player: then a combobox that gets the online list, so you can just select who to talk to and keep in pm with them. However, whenever anyone logs in/out it updates the online list and the combobox with their name is goes blank obviously as its cleared and filled with new info... this is frustrating as hell as you have to select the person you were talking to again.. its stupid. Code: ' :::::::::::::::::::::::::: ' :: Get Online List :: ' :::::::::::::::::::::::::: If LCase(Parse(0)) = "onlinelist" Then frmOnline.lstOnline.Clear frmMainGame.txtplayername.Clear frmMainGame.Refresh n = 2 z = Val(Parse(1)) For X = n To (z + 1) frmOnline.lstOnline.AddItem Trim(Parse(n)) frmMainGame.txtplayername.AddItem Trim(Parse(n)) frmMainGame.Refresh n = n + 2 Next X Exit Sub End If thats the code that sends the online information to the box.. i am completely stuck, i need the box to update but i want it to keep the playername selected IF they are still online... spent 2 hours trying allsorts to try and figure this out any solution is welcome... Foxy edit: oh txtplayername is the combobox, bad naming i know but it was originaly a textbox till i thought this idea would be better.... -.- |
|
| Author: | Lea [ Tue Jun 12, 2007 3:17 am ] |
| Post subject: | Re: OMFG I AM GNA EXPLODE |
Here's some strict theory. Before you clear, store the name of the player in a temporary string. Don't use the combobox index number. Clear and refresh. Loop to find out which index number contains the name you stored earlier. Select that index number Maho! |
|
| Author: | Coke [ Tue Jun 12, 2007 1:55 pm ] |
| Post subject: | Re: OMFG I AM GNA EXPLODE |
I got half way... storing the .text in a string called Q... unsure how to now find out the index of them though o.0 xD |
|
| Author: | Robin [ Tue Jun 12, 2007 2:00 pm ] |
| Post subject: | Re: OMFG I AM GNA EXPLODE |
Code: dim i, combothing as long dim rofl as boolean for i = 1 to combobox.listindex Do until ROFL = true if combobox.w/e = STOREDTEXT then combothingy = i rofl = true loop next Not too sure on how to get the line of text for a certain index in the combobox though :\ I'll look it up if Dave or anyone doesn't know. |
|
| Author: | Coke [ Tue Jun 12, 2007 2:16 pm ] |
| Post subject: | Re: OMFG I AM GNA EXPLODE |
me and robin ended up with: Code: ' :::::::::::::::::::::::::: ' :: Get Online List :: ' :::::::::::::::::::::::::: If LCase(Parse(0)) = "onlinelist" Then Q = frmMainGame.txtplayername.Text frmOnline.lstOnline.Clear frmMainGame.txtplayername.Clear frmMainGame.Refresh n = 2 z = Val(Parse(1)) For X = n To (z + 1) frmOnline.lstOnline.AddItem Trim(Parse(n)) frmMainGame.txtplayername.AddItem Trim(Parse(n)) frmMainGame.Refresh n = n + 2 Next X Dim r, combothing As Long Dim rofl As Boolean For r = 1 To frmMainGame.txtplayername.ListIndex Do Until rofl = True If frmMainGame.txtplayername.Text = Q Then combothing = r rofl = True End If Loop Next its not searching through the combobox though, just need the last piece of the jigsaw? xP |
|
| Author: | Coke [ Tue Jun 12, 2007 2:30 pm ] |
| Post subject: | Re: OMFG I AM GNA EXPLODE |
Alright dave i think this is one for you or Verrigan xD Code: ' :::::::::::::::::::::::::: ' :: Get Online List :: ' :::::::::::::::::::::::::: If LCase(Parse(0)) = "onlinelist" Then Q = frmMainGame.cmbPlayerName.Text frmOnline.lstOnline.Clear frmMainGame.cmbPlayerName.Clear frmMainGame.Refresh n = 2 z = Val(Parse(1)) For X = n To (z + 1) frmOnline.lstOnline.AddItem Trim(Parse(n)) frmMainGame.cmbPlayerName.AddItem Trim(Parse(n)) frmMainGame.Refresh n = n + 2 Next X Dim r, combothing As Long Dim rofl As Boolean For r = 1 To frmMainGame.cmbPlayerName.ListCount Do Until rofl = True Or r = frmMainGame.cmbPlayerName.ListCount frmMainGame.cmbPlayerName.ListIndex = frmMainGame.cmbPlayerName.ListIndex + 1 If frmMainGame.cmbPlayerName.Text = Q Then combothing = r rofl = True End If DoEvents Loop Next When players log-in it keeps your pm buddy selected, but when they logout it doesent... o.o |
|
| Author: | Robin [ Tue Jun 12, 2007 3:10 pm ] |
| Post subject: | Re: OMFG I AM GNA EXPLODE |
I'm utterly lost lol. I dunno why it doesn't do it when you log off... Well, I got you so far lol xD |
|
| Author: | Coke [ Tue Jun 12, 2007 6:52 pm ] |
| Post subject: | Re: OMFG I AM GNA EXPLODE |
Got it working, thanks to everyone for their help |
|
| Author: | Coke [ Tue Jun 12, 2007 9:34 pm ] |
| Post subject: | Re: OMFG I AM GNA EXPLODE |
alright i have found a single bug, basicaly if your whispering to a player then they leave it crashes due to it cant find their name... unsure as to how to word the fix.. heres the code: Code: ' :::::::::::::::::::::::::: ' :: Get Online List :: ' :::::::::::::::::::::::::: If LCase(Parse(0)) = "onlinelist" Then If frmMainGame.cmbPlayerName.Text = "" Then Q = frmMainGame.cmbPlayerName.Text frmOnline.lstOnline.Clear frmMainGame.cmbPlayerName.Clear frmMainGame.Refresh n = 2 z = Val(Parse(1)) For X = n To (z + 1) frmOnline.lstOnline.AddItem Trim(Parse(n)) frmMainGame.cmbPlayerName.AddItem Trim(Parse(n)) frmMainGame.Refresh n = n + 2 Next X Exit Sub Else Q = frmMainGame.cmbPlayerName.Text frmOnline.lstOnline.Clear frmMainGame.cmbPlayerName.Clear frmMainGame.Refresh n = 2 z = Val(Parse(1)) For X = n To (z + 1) frmOnline.lstOnline.AddItem Trim(Parse(n)) frmMainGame.cmbPlayerName.AddItem Trim(Parse(n)) frmMainGame.Refresh n = n + 2 Next X Dim r, combothing As Long Dim rofl As Boolean For r = 1 To frmMainGame.cmbPlayerName.ListCount Do Until rofl = True Or r = frmMainGame.cmbPlayerName.ListCount frmMainGame.cmbPlayerName.ListIndex = frmMainGame.cmbPlayerName.ListIndex + 1 If frmMainGame.cmbPlayerName.Text = Q Then combothing = r rofl = True End If DoEvents Loop Next End If btw the code seems twice as long as it needs to be, but this way when people leave it keeps it.. its a bloody wierd way of doing it but oh well xD |
|
| Author: | Robin [ Tue Jun 12, 2007 9:52 pm ] |
| Post subject: | Re: OMFG I AM GNA EXPLODE |
Code: If findplayer(r) = false then exit sub end if Not sure about the true syntax for "findplayer" but that should if you set it up correctly. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|