i tried to ask on this post but its too old https://www.sapien.com/forums/viewtopic.php?f=21&t=7620&p=37750&hilit=Font+change#p37750
im creating an app that scans a computer lets say my threshold for a folder is 200 MB and it finds one that is 220. I want it to check the box (done), change the text to red ( done ) and bold so it stands out but everything I've tried for the last several hours is not working.
Bold text if checkbox = checked
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- SAPIEN Support Forums
- Posts: 945
- Last visit: Thu Oct 22, 2015 1:10 pm
Bold text if checkbox = checked
This is an automated post. A real person will respond soon.
Thank you for posting, localpct.
Here are some hints to help you get an accurate and complete answer to your question.
Ask in the best forum:
Anticipate follow-up questions!
Did you remember to include the following?
*** Make sure you do not post any licensing information ***
Thank you for posting, localpct.
Here are some hints to help you get an accurate and complete answer to your question.
Ask in the best forum:
- - Scripting question? For questions about Windows PowerShell or other scripting languages, use Scripting Answers.
- Software question? For questions about PowerShell Studio, PrimalScript, or other SAPIEN products, use Product Support Forums for Registered Customers.
- Trial question? For questions about trial versions of any SAPIEN product, use Trial Software Questions.
Anticipate follow-up questions!
Did you remember to include the following?
- 1. Product, version and build
2. 32 or 64 bit product
3. Operating system, e.g. Windows 7 64 bit.
4. Attach a screenshot, if applicable
5. Attach logs, crash reports, etc., in a ZIP file
*** Make sure you do not post any licensing information ***
Re: Bold text if checkbox = checked
Imagine a form with 10 checkboxes
Each of those check boxes have text the the right for example
Hard Drive Space
Size of SCCM Folder
Size of wintemp folder
Etc...
I press go and it runs through the script, if an item passes my threshold, it stays unchecked, font turns green and no bolding. Now let's say my threshold for my Hard Disk Space is 20 gigs free and it has 18 Gigs free. I want the checkbox to check itself, font color to turn red ( both of these Ive figured out ) and the font to turn bold so a technician can quickly look at the form and know what passed and what didn't.
Makes sense?
Each of those check boxes have text the the right for example
Hard Drive Space
Size of SCCM Folder
Size of wintemp folder
Etc...
I press go and it runs through the script, if an item passes my threshold, it stays unchecked, font turns green and no bolding. Now let's say my threshold for my Hard Disk Space is 20 gigs free and it has 18 Gigs free. I want the checkbox to check itself, font color to turn red ( both of these Ive figured out ) and the font to turn bold so a technician can quickly look at the form and know what passed and what didn't.
Makes sense?
Re: Bold text if checkbox = checked
I can suggest a good stating place to learn how to build a form.
These articles will get you started.
https://www.sapien.com/blog/topics/user ... istrators/
https://www.sapien.com/blog/topics/spo ... -controls/
These articles will get you started.
https://www.sapien.com/blog/topics/user ... istrators/
https://www.sapien.com/blog/topics/spo ... -controls/
- dan.potter
- Posts: 709
- Last visit: Wed Nov 14, 2018 11:39 am
Re: Bold text if checkbox = checked
My preference is to use label images and the image list control. You can easily find icons on the internet like a green check or red x.localpct wrote:Imagine a form with 10 checkboxes
Each of those check boxes have text the the right for example
Hard Drive Space
Size of SCCM Folder
Size of wintemp folder
Etc...
I press go and it runs through the script, if an item passes my threshold, it stays unchecked, font turns green and no bolding. Now let's say my threshold for my Hard Disk Space is 20 gigs free and it has 18 Gigs free. I want the checkbox to check itself, font color to turn red ( both of these Ive figured out ) and the font to turn bold so a technician can quickly look at the form and know what passed and what didn't.
Makes sense?
Based on the condition assign the image to the label.
PowerShell Code
Double-click the code block to select all.if (($checkc.size/1gb -gt $cdrive) -and ($checkd.size/1gb -gt $ddrive) -and ($checke.size/1gb -gt $edrive)) { $labelDriveSpecs.ImageIndex = 0 } else { $labelDriveSpecs.ImageIndex = 1
Re: Bold text if checkbox = checked
Thanks for the help!
Does it matter if the image is an .ico or .png etc??
When I try your script and I've defined both
$cdrive and $checkC if I just use text it's fine but if I use an image I get
The property 'ImageIndex' cannot be found on this object. Verify that the property exists and can be set.
Does it matter if the image is an .ico or .png etc??
When I try your script and I've defined both
$cdrive and $checkC if I just use text it's fine but if I use an image I get
The property 'ImageIndex' cannot be found on this object. Verify that the property exists and can be set.
- Attachments
-
- PCHEALTHsendout.psf
- (637.29 KiB) Downloaded 172 times
Re: Bold text if checkbox = checked
I have a feeling I'm just setting a value wrong. I'm not just looking for answers as I don't believe this is too hard of a problem.
Re: Bold text if checkbox = checked
You are setting the "imageList" control on the image collection and not on the label control
Part of the cause of this is that you have named the ImageList control as "labelDriveSpecs" when it has nothing to do with labels or drives.
Part of the cause of this is that you have named the ImageList control as "labelDriveSpecs" when it has nothing to do with labels or drives.