Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Controls
  New Posts New Posts RSS Feed - ComboBox with Markup
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ComboBox with Markup

 Post Reply Post Reply
Author
Message
ScottW View Drop Down
Groupie
Groupie


Joined: 02 August 2005
Status: Offline
Points: 82
Post Options Post Options   Thanks (0) Thanks(0)   Quote ScottW Quote  Post ReplyReply Direct Link To This Post Topic: ComboBox with Markup
    Posted: 02 February 2009 at 5:37pm
I have run into an issue with the ComboBox control that I hope there is a way to fix. When using markup with combodropdownlist style, selecting works great and shows the markup in the text box part. However, in combodropdown mode, you see the markup in the text box after you select an item. Yuck! I tried to use the click event to change the ComboBox text property to the text without the markup, but it only works the first time, after that it shows the markup even after I change the property.

If you make a VB6 Form with a single ComboBox control on it, you can paste in this form code to duplicate:

Option Explicit

Private Sub ComboBox1_Click()

Debug.Print "Click", ComboBox1.Text,
    ComboBox1.Text = Mid$(ComboBox1.Text, 12, 6)
Debug.Print , ComboBox1.Text

End Sub

Private Sub Form_Load()

Debug.Print "--------------------"

    With ComboBox1
        .EnableMarkup = True
   
        .AddItem "<TextBlock>Item 1</TextBlock>"
        .AddItem "<TextBlock>Item 2</TextBlock>"
        .AddItem "<TextBlock>Item 3</TextBlock>"
       
        .ListIndex = 1
    End With

End Sub

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.109 seconds.