c# - How do you style a single TextBox among others? -


i have wpf textbox among others create style for.

this style should apply type of textbox.

here textbox:

<textbox text="{binding deviceinformation.serialnumber, mode=oneway}"  borderthickness="0" background="transparent" isreadonly="true"/> 

my text box simulates label can copy.

how make style , target textbox?

if set key property on style definition, applied on textboxes have set style. style={staticresource=examplekey}

example:

 <window.resources>         <style targettype="textbox" x:key="examplestyle">             <setter property="borderthickness" value="0"></setter>         </style>     </window.resources> 

you can have application-wide styles defined in app.xaml


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -