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

Label with Markup Forecolor problem

 Post Reply Post Reply
Author
Message
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Topic: Label with Markup Forecolor problem
    Posted: 10 September 2014 at 8:27am
SuitePro v.13.4.0

I have a Label control with EnabledMarkup = True.

The Caption property contains the text below:
<TextBlock HorizontalAlignment='Center'> <Bold>F</Bold>att. o <Bold>R</Bold>ic. </TextBlock>
This work fine.

But I can not run time to set the text as disabled!

- Set Label1.Enabled = False doesn't wotk
- Set Label1.Forecolor = vbGrayText (or any other color) doesn't work

the forecolor still black.

How to ?
gibra
CJ SuiteControl v: 13.x to 19.x
Windows 10 64bit
VS2019 - VB6.0 SP6
<a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8
Back to Top
wlcabral View Drop Down
Groupie
Groupie
Avatar

Joined: 25 April 2007
Location: Brazil
Status: Offline
Points: 72
Post Options Post Options   Thanks (0) Thanks(0)   Quote wlcabral Quote  Post ReplyReply Direct Link To This Post Posted: 18 September 2014 at 7:22pm
I think you should work with the caption

if Label1.Enabled
    Label1.caption = "<TextBlock HorizontalAlignment='Center' Foreground='Red' > <Bold>F</Bold>att. o <Bold>R</Bold>ic. </TextBlock>"
else

    Label1..caption = "<TextBlock HorizontalAlignment='Center' Foreground='Gray' > <Bold>F</Bold>att. o <Bold>R</Bold>ic. </TextBlock>"

endif

I hope it helps...
wlcabral
Back to Top
gibra View Drop Down
Senior Member
Senior Member


Joined: 31 October 2008
Location: Italy
Status: Offline
Points: 288
Post Options Post Options   Thanks (0) Thanks(0)   Quote gibra Quote  Post ReplyReply Direct Link To This Post Posted: 19 September 2014 at 2:28pm
Thanks for the reply,Smile
but your code is not very functional for my purpose. 

Let me explain, I use this routine to enable / disable all the controls on a form: 
 
Public Function EnableDisableForm (ByRef f As Form, ByVal bState As Boolean) 
     Dim c As Control 
     For Each c In f.Controls 
         c.Enabled = bState 
     Next 
end Function 
 

It 'obvious that within a cycle, your suggestion, although it works, is not feasible because it requires to check for each control
- The type of control 
- If it supports the markup 
- If the EnableMarkup property is enabled, or not 
- If the Caption contains instructions to modify markup istructions 
- To parse the string because the markup instructions can be very different from one control to another.

In short, it is not so simple.

Thank again.

gibra
CJ SuiteControl v: 13.x to 19.x
Windows 10 64bit
VS2019 - VB6.0 SP6
<a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8
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.141 seconds.