I have a C#/XAML Metro-style application with a TextBox. By default, the TextBox displays with a gray background. When I hover over it with my mouse, the background lightens. When I put my focus into the TextBox, it has a white background.
I want to create a XAML style that will cause the TextBox to always have a white background, regardless of the position of my mouse or where my focus is in the application - how can I do this?
Thanks!
Andrew
You need to edit the control template.
Related
I'm developing a Universal Windows App in VS2015 (C#, XAML).
I have an AppBarButton on a RelativePanel, The panel's background is black.
When I move the mouse over the button (Hover), it turns black with a darkgray background, which is not visible on a dark background:
Please tell me how to change the colors for the button in all mouse states: hover, mousedown,...etc.
Thank you
You need to create custom style template for button to overwrite the hover effect and behaviour.
Please open the button in Blend by using Edit A copy and then edit its template! you might need to remove some element.
Mostly it shall be a button as the property of changing color is exhibited by a button control
I have a form with an A4 image in the background (a standard questionaire). on that form i have textfields to fill. But if we scroll to the bottom of the form, the textfields scroll, but the background does not. How to fix the background to stick with the texfields ? VB.NET visual studio 2010.
Place a panel on the Form.
Place all your controls inside the panel.
Set the Background of the panel to your image.
Size your panel so that it is large enough to hold all the controls.
Place the panel at 0,0
Set the Form to AutoScroll
In my Windows Phone App I want to have a TextBox which must be readOnly, but this makes its Foreground color look grayish, I want the Foreground color to be black, Is that possible?
Or how else can I have a textblock with black font, but not editable by the user?
You can change the Style of your TextBox for the disabled state.
To achieve this more easily, you can open your .xaml document in Expression Blend, Right Click in your TextBox -> Edit Template... -> Edit a Copy.
Then you choose the name you want for your Style.
After that search for the States Tab, and click it. After that choose the disabled state.
Then you can edit the TextBox to be whatever you like for the disabled state.
Also you can just set TextBox Style to null, and set Foreground as usual.
I have created an app starting from the Grid App template (C#/XAML) of Visual Studio 2012. I'm using the Light Theme and I have customized the GridViewItem brushes so that the color blue is used when I move the mouse over an item.
Now I would like to change the foreground color of the text that is shown in the GridView when the mouse is over the item, using white to make it more readable. Is it possible, considering that the layout of GridView items is defined in a DataTemplate?
Here is an blog post which demonstrates styling of GridViewItem.
I have a borderless form that I'm "docking" onto the top edge of my screen. Inside of the form, I'm placing a single toolstrip control, which docks across the entire form -> (picture the taskbar to get an idea of what I'm talking about).
Because the borderless form has no edge to it, I wanted to draw a black line along the bottom edg` of the form to differentiate the form from the windows or desktop behind it.
The problem that I'm facing is that`the toolstrip will not move "behind" the line when it's docked, no matter how I order the control layers.
I've tried programatically sending the control to back to no avail either.
Any ideas on how to get the line to show above the docked toolstrip?
Dock another control to the top that displays like a black line (e.g. a Label with a black background and a height of 1). Insert your ToolStrip after you have docked the Label. It will dock just below the Label.