Print Page | Close Window

ComboBox with Markup

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=13318
Printed Date: 05 October 2024 at 6:26pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ComboBox with Markup
Posted By: ScottW
Subject: ComboBox with Markup
Date 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




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net