Forum Discussion

ayesha_pansare's avatar
12 years ago

Getting Textbox border color

There is a text box higlighted with red border. If we enter the correct value the border is invisible but if we enter the wrong value the border is still highlighted.
Any suggestion of how to get the color property.
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Ayesha,


     


    The approach you can use depends on the control you are using. What is the name and vendor of the control? Also, please let us know what kind of application (WPF, .NET, VCL) you are using.


     

  • yurik's avatar
    yurik
    Contributor

    I have the same question :
     TextBox and ComboBox are displayed with the red border around them, when empty. I can see that Effect parameter is not null when the TextBox is empty and the BorderBrush property is null. When the TextBox is populated, the Effect property becomes null. For the ComboBox the BorderBrush is not null but it doesn't change regardless of whether the ComboBox is empty or not.

    How can I validate that the Red border is displayed around a TextBox and ComboBox for WPF controls?

     

    Thanks!

     

    • yurik's avatar
      yurik
      Contributor

      I've changed the WPF Controls: disabled "Simplified WPF object tree" and added ComboBox and TextBox to "Composite controls" (see attached). Now I can see TextBoxBorder and ComboBoxBorder and there the BorderBrush object is accessible with an appropriate Color object. This is a good part

      The bad thing is that all my mappings do not work now, because I mapped the objects with "Simplified WPF object tree" enabled. Does it mean that I need to re-map all the objects now or is there a way around it?

       

      Thank you!

       

       

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        While you might get a performance penalty, I would try to enable the Extended Find for the problematic mapped controls and check if this helps.

        (Extended Find column might be not shown for the namemapping tree table in the NameMapping editor. If this is the case, right-click table's header and make it visible.)