Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


VB6 Combo Box

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Blader
I post too much
Reputation: 2

Joined: 19 Jan 2007
Posts: 2049

PostPosted: Wed Nov 14, 2007 4:53 pm    Post subject: VB6 Combo Box Reply with quote

I need help making a combo box (drop down menu)
I already set it up, and what I want is when I click something in the menu, it does something

Like this:

When I click option1
Do something
When I click option2
Do something
When I click option3
Do something
End Sub

I just need the "When I click option" thingy
The options I have are
High, Medium, Low

Thanks Smile

_________________
Back to top
View user's profile Send private message
Pseudo Xero
I post too much
Reputation: 0

Joined: 16 Feb 2007
Posts: 2607

PostPosted: Wed Nov 14, 2007 5:06 pm    Post subject: Reply with quote

I don't know if VB6 has it, but use the "SelectedIndexChanged" event, and then you can use Select Case on ComboBox.Text.
_________________
haxory' wrote:
can't VB do anything??
windows is programmed using VB right? correct me if im wrong.

so all things in windows you have like the start menu is a windows form too.
Back to top
View user's profile Send private message
Blader
I post too much
Reputation: 2

Joined: 19 Jan 2007
Posts: 2049

PostPosted: Wed Nov 14, 2007 5:24 pm    Post subject: Reply with quote

Nvm I got it, found something in google =)
_________________
Back to top
View user's profile Send private message
TheIndianGuy
Advanced Cheater
Reputation: 102

Joined: 14 Jan 2007
Posts: 88

PostPosted: Wed Nov 14, 2007 5:29 pm    Post subject: Reply with quote

Blader wrote:
Nvm I got it, found something in google =)


now your learning! Razz
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Nov 14, 2007 5:39 pm    Post subject: Reply with quote

Quick example if anyone else requests:

Code:
Option Explicit

Private Sub Form_Load()
'--------------------------
' Add Items To Combo Box
'--------------------------
    Combo1.AddItem "Item 1" '// List Index 0
    Combo1.AddItem "Item 2" '// List Index 1
    Combo1.AddItem "Item 3" '// List Index 2
End Sub

Private Sub Combo1_Click()
    Select Case Combo1.ListIndex
        Case 0
            MsgBox "Item 1 selected"
        Case 1
            MsgBox "Item 2 selected"
        Case 2
            MsgBox "Item 3 selected"
    End Select
End Sub

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites