Print Page | Close Window

Label with Markup Forecolor problem

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=22407
Printed Date: 05 October 2024 at 7:35pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Label with Markup Forecolor problem
Posted By: gibra
Subject: Label with Markup Forecolor problem
Date 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



Replies:
Posted By: wlcabral
Date 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


Posted By: gibra
Date 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



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