Combo Box dropdown list 
Author Message
 Combo Box dropdown list

I am using the Combo box dropdown list with four states in it (VIC, NSW, SA, Queensland).
When the user selects the required state, I want a .rtf file relating to that state to load and display
in a Richtextbox next to the Combo box.
Can someone  advise me of the most commom way to achieve this with a sample code snippett
if possible.

many thanks.....rob



Wed, 05 Feb 2003 10:28:00 GMT  
 Combo Box dropdown list
Use the LoadFile method

Supposing the filenames for the states are "C:\VIC.rtf", "C:\NSW.rtf",
"C:\SA.rtf" and "C:\Queensland.rtf" use the following:
Private Sub Combo1_Click()
    RichTextBox1.LoadFile "C:\" & Combo1.Text & ".rtf"
End Sub

When the filenames are not the same as the state-names, you can use somethig
like:
Private Sub Combo1_Click()
Dim sFileName As String
    sFileName = Choose(Combo1.ListIndex + 1, _
            "C:\State VIC.rtf", _
            "C:\Other state.rtf", _
            "C:\SA.rtf", _
            "C:\Ql.rtf")
    RichTextBox1.LoadFile sFileName
End Sub

Hope this helps,
Johan.



I am using the Combo box dropdown list with four states in it (VIC, NSW, SA,
Queensland).
When the user selects the required state, I want a .rtf file relating to
that state to load and display
in a Richtextbox next to the Combo box.
Can someone  advise me of the most commom way to achieve this with a sample
code snippett
if possible.

many thanks.....rob



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Combo Box / Dropdown list

2. Combo Box Dropdown List Width

3. Newbie: Set a combo box style(2)/Dropdown list to the first element in the list

4. Newbie: Set a combo box style(2)/Dropdown list to the first element in the list

5. Newbie: Set a combo box style(2)/Dropdown list to the first element in the list

6. How to control the number it items in a combo box dropdown list?

7. Default value for dropdown combo list box?

8. Combo Box - no2 dropdown list problem

9. COMBO BOX, STYLE : DROPDOWN LIST

10. Locked Combo Box BUG (Dropdown List Style)

11. How to list macro names in a combo box or a list box

12. Dropdown List Box and Long List Items

 

 
Powered by phpBB® Forum Software