Print Page | Close Window

How do you get caption of a markuped combobox?

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=19573
Printed Date: 30 November 2024 at 11:17am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How do you get caption of a markuped combobox?
Posted By: Norika
Subject: How do you get caption of a markuped combobox?
Date Posted: 14 March 2012 at 2:39am

Hi,

Everytime, I have to get the text like below. Do you know another good way?

Public Function GetMarkupTextBlock_Caption$(strTextBlockText$)

    Dim strTB_Start$
    Dim strTB_End$
   
    strTB_Start = "<TextBlock"
    strTB_End = "</TextBlock>"
   
    Dim s$
    Dim i As Long
   
    s = Mid(strTextBlockText, InStr(strTextBlockText, strTB_Start) + Len(strTB_Start) + 1)
    s = Mid(s, InStr(s, ">") + 1)
    s = Left(s, InStr(s, strTB_End) - 1)

    GetMarkupTextBlock_Caption = s

End Function

https://forum.codejock.com/uploads/2548/Markup_ComboBox.zip - uploads/2548/Markup_ComboBox.zip

Regards,
Norika --
Windows XP SP3
Visual Basic 6.0 with SP6
Xtreme SuitePro ActiveX v15.2.1




Replies:
Posted By: jpbro
Date Posted: 14 March 2012 at 3:35pm
You can use the MarkupList() for XAML and AddItem for plain text as follows:


        .AddItem "abcde"
        .MarkupList(.NewIndex) = "<TextBlock Padding = '4,2,0,2' FontWeight='Bold' FontSize='13' VerticalAlignment='Center' HorizontalAlignment='Left'>ab<Run Foreground='Red'>c</Run>de</TextBlock>"
       
        .AddItem "fghij"
        .MarkupList(.NewIndex) = "<TextBlock Padding = '4,2,0,2' FontWeight='Bold' FontSize='13' VerticalAlignment='Center' HorizontalAlignment='Left'>fghij</TextBlock>"
       
        .AddItem "klmno"
        .MarkupList(.NewIndex) = "<TextBlock Padding = '4,2,0,2' FontWeight='Bold' FontSize='13' VerticalAlignment='Center' HorizontalAlignment='Left'>klmno</TextBlock>"


Or for existing projects where you don't want to change a lot of code, you can check out my XAML stripper:
http://forum.codejock.com/forum_posts.asp?TID=14928&title=xaml-stripper - http://forum.codejock.com/forum_posts.asp?TID=14928&title=xaml-stripper


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: Norika
Date Posted: 19 March 2012 at 12:27am
Dear jpbro,
 
Thank you very much for your advice and suggestion.
I'm going to change my source code for using MarkupList.
 
Best Regards,
 



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