cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dave8
Impactful Individual
Impactful Individual

How do I change Border color of the label if dropdown value is blank?

Hello,

 

I have Dropdown1[Blank(),"1","2","3"]

 

Then, Label1.Bordercolor = If(IsBlank(Dropdown1.Selected.Value) = true, Color.Red,Color.DimGrey)

 

However, if Dropdown1.Selected.Value == Blank, Border color of LAbel1 doesn't change.

 

Can you please help how can I change the color of the border?

 

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions

@dave8 

When a label is disabled you must change these properties to achieve the desired effect.  This allows you to design the look of the disabled label.

 

  • DisabledBorderColor
  • DisabledColor
  • DisabledFill

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

3 REPLIES 3
mdevaney
Super User
Super User

@dave8 

Your code appears to be 100% correct.  My thought is the BorderThickness property is currently set to 0.  You should increase it to this size instead.

 

2

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

dave8
Impactful Individual
Impactful Individual

@mdevaney 

 

That's true, However, I just realized that "Label1.DisplayMode = Disabled" too.

 

Is there any workaround to change the color of label1 in disabled mode?

 

Thanks,

@dave8 

When a label is disabled you must change these properties to achieve the desired effect.  This allows you to design the look of the disabled label.

 

  • DisabledBorderColor
  • DisabledColor
  • DisabledFill

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,397)