Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Controls
  New Posts New Posts RSS Feed - How do you get caption of a markuped combobox?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How do you get caption of a markuped combobox?

 Post Reply Post Reply
Author
Message
Norika View Drop Down
Groupie
Groupie
Avatar

Joined: 30 November 2006
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Norika Quote  Post ReplyReply Direct Link To This Post Topic: How do you get caption of a markuped combobox?
    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

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

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post 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
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
Norika View Drop Down
Groupie
Groupie
Avatar

Joined: 30 November 2006
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Norika Quote  Post ReplyReply Direct Link To This Post 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,
 
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.172 seconds.