Results 1 to 11 of 11

Thread: Change the color of Combo Item font **RESOLVED**

  1. #1

    Thread Starter
    Hyperactive Member Daskalos's Avatar
    Join Date
    Jun 2002
    Location
    Just behind YOU...
    Posts
    364

    Thumbs up Change the color of Combo Item font **RESOLVED**

    Hello all
    well, I have this in my prog:
    VB Code:
    1. Private Sub AddB_Click()
    2. On Error Resume Next
    3. If iBandas.ListIndex = 0 Then
    4. Text1(0).Visible = True
    5. Text1(0).Text = iBandas.Text
    6. Else
    7. Load Text1(iBandas.ListIndex)
    8. Text1(iBandas.ListIndex).Text = iBandas.Text
    9. Text1(iBandas.ListIndex).Visible = True
    10. Text1(iBandas.ListIndex).Top = Text1(0).Top + iBandas.ListIndex * 375
    11. End If
    12. End Sub
    13.  
    14. Private Sub Form_Load()
    15. Dim MyFile As String
    16. Dim MyPath  As String
    17. MyPath = "C:\Bandas\"
    18.  
    19. MyFile = Dir(MyPath)
    20.  
    21. Do While MyFile <> ""
    22. iBandas.AddItem MyFile
    23. MyFile = Dir
    24. Loop
    25. End Sub
    26.  
    27. Private Sub RemB_Click()
    28. On Error Resume Next
    29. If iBandas.ListIndex = 0 Then
    30. Text1(0).Visible = False
    31. Text1(0).Text = ""
    32. Else
    33. Text1(iBandas.ListIndex).Text = ""
    34. Unload Text1(iBandas.ListIndex)
    35. End If
    36. End Sub
    so, when i click in Button AddB it loads on text box and the text in combo1...
    well.. i need that if an Item have already been loaded, its name in Combo1 changes the font color, or something to know that that item have already been loaded...
    understand??

    thanks in advance
    Last edited by Daskalos; Dec 6th, 2003 at 06:21 PM.
    [vbcode]Dim Daskalos As NewBie
    If My.english = Wrong Then
    Forgive My.Poor.English
    End If[/vbcode]
    Ða§kalø§
    ICQ#: 36146307
    Current ICQ status:
    More ways to contact me

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344
    Hope this helps you solve your problem:

    VB Code:
    1. Dim i As Integer, index As Integer
    2.  
    3. Private Sub Combo1_Click()
    4. For i = 0 To List1.ListCount - 1
    5. If Combo1.Text = List1.List(i) Then
    6. MsgBox ("Item Already Exists"), vbCritical
    7. List1.RemoveItem (index)
    8. Else
    9. End If
    10. Next i
    11. List1.AddItem Combo1.Text
    12. End Sub

    Nightwalker83
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  3. #3

    Thread Starter
    Hyperactive Member Daskalos's Avatar
    Join Date
    Jun 2002
    Location
    Just behind YOU...
    Posts
    364
    thanks, but it's not what I need..
    i need to show to the user that the item from the Combo have already been added... so, the better for this, in my case, is to chage the item color, or font, so the user will see it before clicking in ADD again..

    is that possible?

    thanks in advance
    [vbcode]Dim Daskalos As NewBie
    If My.english = Wrong Then
    Forgive My.Poor.English
    End If[/vbcode]
    Ða§kalø§
    ICQ#: 36146307
    Current ICQ status:
    More ways to contact me

  4. #4
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344
    Do you have to change the font colour of the combo box text. Wouldn't it be better to change the colour of the text in the listbox?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  5. #5

    Thread Starter
    Hyperactive Member Daskalos's Avatar
    Join Date
    Jun 2002
    Location
    Just behind YOU...
    Posts
    364
    there is no List box
    [vbcode]Dim Daskalos As NewBie
    If My.english = Wrong Then
    Forgive My.Poor.English
    End If[/vbcode]
    Ða§kalø§
    ICQ#: 36146307
    Current ICQ status:
    More ways to contact me

  6. #6
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344
    Oh sorry I ment change the text colour in the textboxes.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  7. #7

    Thread Starter
    Hyperactive Member Daskalos's Avatar
    Join Date
    Jun 2002
    Location
    Just behind YOU...
    Posts
    364
    the problem is that the textboxes are there only for testing purpouses...
    when the user clicks in the Add button, it will add a picture in another form... so, it will be a little boring if he needs to remember the name of the items to remove them later..

    any idea??
    [vbcode]Dim Daskalos As NewBie
    If My.english = Wrong Then
    Forgive My.Poor.English
    End If[/vbcode]
    Ða§kalø§
    ICQ#: 36146307
    Current ICQ status:
    More ways to contact me

  8. #8

  9. #9

    Thread Starter
    Hyperactive Member Daskalos's Avatar
    Join Date
    Jun 2002
    Location
    Just behind YOU...
    Posts
    364
    wow.. i tried to understand this code.. but i really can't..
    i have another idea..
    when the user click in Add button
    VB Code:
    1. iBandas.List(iBandas.ListIndex) = iBandas.List(iBandas.ListIndex) & "**"

    but how could I remove the two last caracters (**)later on??

    thanks for all the replies
    [vbcode]Dim Daskalos As NewBie
    If My.english = Wrong Then
    Forgive My.Poor.English
    End If[/vbcode]
    Ða§kalø§
    ICQ#: 36146307
    Current ICQ status:
    More ways to contact me

  10. #10

  11. #11

    Thread Starter
    Hyperactive Member Daskalos's Avatar
    Join Date
    Jun 2002
    Location
    Just behind YOU...
    Posts
    364
    thanks a lot

    see ya
    [vbcode]Dim Daskalos As NewBie
    If My.english = Wrong Then
    Forgive My.Poor.English
    End If[/vbcode]
    Ða§kalø§
    ICQ#: 36146307
    Current ICQ status:
    More ways to contact me

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width