To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
MSDN Subscribers: Download the VS 2010 Release Candidate
MSDN Subscribers: Download the VS 2010 Release Candidate
Sell Your Code and Make Money?
Creating your own Tetris game using VB.NET
Article :: Improving Software Economics, Part 4 of 7: Top 10 Principles of Iterative Software Management



Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier

Reply Post New Thread
 
Thread Tools Search this Thread Display Modes
Old Feb 12th, 2007, 09:42 PM   #1
matrik02
Frenzied Member
 
matrik02's Avatar
 
Join Date: Feb 07
Location: Malaysia
Posts: 1,349
matrik02 is an unknown quantity at this point (<10)
combo box problem

I use combo box and have 3 items. This combo box follow a sequence.Let say, I choose the activity 2.How I can make the items to the first activity on click event?

Private Sub Cal1_Click()

end sub

this is the first activity "Menebas jerami dengan ‘rotor slasher’. Perlu dilakukan secepat mungkin selepas menuai. Jika lewat batang jerami akan susah dipotong"


and the last activity is "Memeriksa status kesuburan tanah dengan mengambil sample tanah untuk analisis dan memereksa variasi tanah dengan mengambil bacaan EC untuk dibuat peta variasi"

Private Sub Form_Load()
Combo1.AddItem "Menebas jerami dengan ‘rotor slasher’. Perlu dilakukan secepat mungkin selepas menuai. Jika lewat batang jerami akan susah dipotong."
Combo1.AddItem "Memeriksa pasarana, membina taliair, parit buang dan kotak kawalan bagi setiap lot, jika belum ada."
Combo1.AddItem "Memeriksa status kesuburan tanah dengan mengambil sample tanah untuk analisis dan memereksa variasi tanah dengan mengambil bacaan EC untuk dibuat peta variasi."
End Sub
matrik02 is offline   Reply With Quote
Old Feb 13th, 2007, 02:39 AM   #2
matrik02
Frenzied Member
 
matrik02's Avatar
 
Join Date: Feb 07
Location: Malaysia
Posts: 1,349
matrik02 is an unknown quantity at this point (<10)
Re: combo box problem

could somebody help me
matrik02 is offline   Reply With Quote
Old Feb 13th, 2007, 04:37 AM   #3
Bruce Fox
INXSIVE
 
Bruce Fox's Avatar
 
Join Date: Sep 01
Location: Melbourne, Australia
Posts: 7,114
Bruce Fox is a jewel in the rough (200+)Bruce Fox is a jewel in the rough (200+)Bruce Fox is a jewel in the rough (200+)
Re: combo box problem

You could use the ListIndex to identify which item is selected. 0 being the first Item, 2 being the last (in this example).
__________________
Handy References:
MSDN VB6 Library ADO Tutorial Excel Tutorial MZTools
  • Please pull down the Thread Tools menu and click the 'Mark Thread Resolved' button, or alternately edit your original post and add "Resolved" or place a in the subject when your question(s) have been answered.
  • Please use code tags [highlight=vb] your code goes here between the tags [/highlight] when posting code.
Bruce Fox is offline   Reply With Quote
Old Feb 14th, 2007, 11:02 PM   #4
matrik02
Frenzied Member
 
matrik02's Avatar
 
Join Date: Feb 07
Location: Malaysia
Posts: 1,349
matrik02 is an unknown quantity at this point (<10)
Re: combo box problem

could you give me a example of using listIndex for combo box
matrik02 is offline   Reply With Quote
Old Feb 14th, 2007, 11:19 PM   #5
sgrya1
Fanatic Member
 
Join Date: Sep 06
Location: London, UK
Posts: 735
sgrya1  is on a distinguished road (30+)
Re: combo box problem

I not sure if I follow you but is this what you are after?

VB Code:
  1. Private Sub Combo1_Click()
  2. If Combo1.text= "Menebas jerami dengan ‘rotor slasher’. Perlu dilakukan secepat mungkin selepas menuai. Jika lewat batang jerami akan susah dipotong." Then
  3. 'Add code for what you want done.
  4. end sub

Can you explain what you are after any better?
sgrya1 is offline   Reply With Quote
Old Feb 15th, 2007, 12:03 AM   #6
matrik02
Frenzied Member
 
matrik02's Avatar
 
Join Date: Feb 07
Location: Malaysia
Posts: 1,349
matrik02 is an unknown quantity at this point (<10)
Re: combo box problem

Actually, I use calender control and combo box. The item list in the combo box is
Private Sub Form_Load()
combo1.additem "activity1"
combo1.additems " activity2"
End Sub
This items will list in the combo box. I just choose the items in the combo box for activity. Let say, I click the date in calender, and choose the items in combo box, let say activity2.So the sstab1 is true and I get the date information for activity2.
Private Sub Combo1_Click()
If Combo1.Text = "activity2." Then
SSTab1.Visible = True
end if

The click event for calender is :
Private Sub Cal1_Click()
'I want to put the code, that the first activity list is Activity1 in the combo box when I click the calender control
end sub
matrik02 is offline   Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:20 PM.




To view more projects, click here

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.