Valhalla Legends Forums Archive | Battle.net Bot Development | ListView help

AuthorMessageTime
DarkMod
I am using a ListView for my user list in a channel. I have a menu that pops up for ban/kick, whisper etc. The usual... My problem is that I need it to select the person when you click on him/her, and stay on that person. Right now it selects it when you put your cursor over it,and will switch to the next person if you move the cursor down, etc... which makes it very hard for using the menu. I am sure someone here knows how I can fix this, I appreciate the help!!
March 3, 2003, 10:58 PM
ILurker
for channellist being the name of the list where items get added or deleted during join/leave.
[code]
Private Sub channellist_dblClick()

me.popupmenu nameofmenuhere
' the sub menus will be listed during pop up

End Sub
[/code]


if one of the submenu name was ban, and you wanted the action to ban the selected user, you would do,
[code]
Private Sub ban_Click()
Dim selecteduser As String
   selecteduser = ChannelList.SelectedItem
'.selecteduser is the text of the item clicked.
   send "/ban " & selecteduser
End Sub
[/code]
March 4, 2003, 12:13 AM
tA-Kane
Something you could do is set the user's name into a variable before you bring up the menu.

Then, when the user selects an option, you read from that variable instead of directly from the list.
March 4, 2003, 4:56 AM
Etheran
There's a property you can change so that items aren't selected on hover.  
March 4, 2003, 4:32 PM
Camel
[code]Private Sub lvUsers_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
   On Local Error Resume Next 'so it doesnt yell if you click below the last entry
   RaiseEvent OnClick(lvUsers.HitTest(X, Y).Tag, Button)
End Sub[/code]
[code]Private Sub UL_OnClick(uName As String, Button As Integer)
   Select Case Button
...
       Case 2
           mnuUsrPopup.Tag = uName
           PopupMenu mnuUsrPopup
...
   End Select
   
   'txtSend.SetFocus
End Sub[/code]
March 4, 2003, 5:37 PM
DarkMod
:D Thanks guys that was a big help!
March 4, 2003, 7:53 PM

Search