How to hide/remove buttonclick animation - c#

I wonder how you can disable the buttonclick animation from a windows forms button. What I mean is, when you click on the button, it doesnt look like its being pressed, it just stays solid.
I dont want to change it to
button1.enabled = false;
as I still want it clickable and with colour.
Hope you understand what I am asking for, I searched through the properties of the button but I didnt find anything that seemed to work, maybe I missed something?

You must look into following:
FlatStyle property of button
Apply appropriate image for the button
After setting FlatStyle property, you can control appearance on mouse-over and mouse-down by looking into FlatAppearance property.

Related

How to make entire Link Label area clickable?

I've been trying to get to make the whole area clickable, in the picture you can see the size of the linklabel, but only text is clickable, I want to make the background of the link label(the whole area) clickable too, is that possible? How can I do that?
I've tried using
linklabel.LinkArea = new LinkArea();
But it only works for the text that i have. I've checked out StackOverflow Posts such as this or this but i couldn't get something out of it.
You can use a panel, with a mouseclick event on it, after that you can add a label or whatever you want
Panel

Does the GUIStyle.hover state apply to Unity Editor labels (or other controls besides Button)?

I am creating a custom editor window in Unity. I want to have a label change color when the mouse hovers over it. To accomplish this, it would seem that this should work:
GUI.skin.label.hover.textColor = Color.red;
GUILayout.Label("My Label");
But the label still displays as normal with no effect when I hover over it with the mouse.
I've also tried manually creating GUIStyles and passing them as an argument to GUILayout.Label with the same result. If I change the normal state, however, I see the color change.
Is the hover state supported for labels, and if not, what controls is it supported for and how would I find out this information? It seems absent from Unity's docs.
You should be able to use GUI.skin.button if you are only interested in changing the text color.
var myStyle = new GUIStyle(GUI.skin.button);
myStyle.hover.textColor = Color.red;
GUILayout.Label("My Label", myStyle);
However, this has the side effect of taking all of the other qualities of the button style. Your label will look like a button. In theory you could change the background image for all of the style states and make it look not like a button, but doing so for the normal state reverts the hover behavior to that of a label style. This answer in the unity Q&A seems to be the most insightful explanation for why hover does not work (at least, not usually) but normal and active do.
In short, unity has special code for built in GUI styles that have hover over effects that force a redraw when the mouse passes over them. This seems to somehow be tied up in the normal style state for certain special styles, such as GUI.skin.button. The result, there is no option to have custom hover backgrounds, and anything that does need to have a custom hover text color must have the same background image as one of the built-in button styles.

How to delete, skip background of arrow Button in WPF

I have image below.
I put it in my button control. I got button like this
I want to get button like on the first image.
Like arrow, not like button with image of arrow.
My application will be touch application.
How I can achive it?
What you see in second image is the default ControlTemplate of the button. To make it look like first image, you should customize the ControlTemplate of the button. Expression Blend may help you.
https://msdn.microsoft.com/en-us/library/cc294908.aspx?f=255&MSPPError=-2147217396

How can I add a border, or otherwise emphasize a 3d-styled button?

I have a set of three buttons labeled 1, 2 and 3 for a touchscreen application interface.
When the user clicks one, it should be "selected" and have some kind of obvious change that shows this.
When using a flat button style I can do this with a border, however it seems this does not apply to Buttons with the default/3d style.
I've noticed the backcolor can be set, however this only seems to apply plain colors, which generally looks pretty ugly.
Is there a way I can add something like a border or emphasize the "selected" 3d-styled button in another way? Is there a better control for this purpose that works well with touch screen interfaces?
A button cannot indicate a "selected" state, it can only have the focus. Which is of no use in a touch screen app.
What you want is a CheckBox instead. Which also supports looking like a button, set its Appearance property to Button. You can further tinker with the way it looks by modifying the FlatStyle property. By setting it to Popup for example it acquires a 3D-look when checked.
Well, I was able to add an inset border using:
class BorderButton : Button
{
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.DrawRectangle(new Pen(Color.Black, 6), this.DisplayRectangle);
}
}
It seems however the paint event can't draw outside of the button's borders, so an outset one wouldn't be possible using this technique.
I've had the same problem and now always use a label instead. This way you can catch the on_click or mousedown events and apply background colours or images as if it was a button.

button pressed effect when another button is pressed

in my WP7 app using silverlight controls,
I have two buttons,
I want to make when I press a button, the other button seems like it's also being pressed (change of color to invert...etc)
something like the native keyboard on wp7 phones when the larger button appear above your thumb
I tried to give both of them the focus, but it's not possible
-Detailed Explanation-
usually, when you press a button, the button style changes according to the theme,
ex: if theme is dark, the button becomes white and the text becomes black. but if the theme is white, the button becomes black when clicked.
My aim is to mimic that behavior to a button when another button is pressed.
In the click event you could use
VisualStateManager.GoToState(Button1, "Pressed", true);
however to go back to the Normal state you would have to know when the click is over. LeftMouseButtonUp does not work because there is no mouse.
So you could set a timer and revert the state. Ugly but it works.
On a side note: I suspect the design you might want to use a different way of getting the result you need.
I haven't done much wp7 development but I believe the normal, active and pressed appearances are implemented as different states of the button and you can programatically set the state. This article should explain it in a bit more detail but the advantage of this approach over manually setting background colours is that it should automatically take advantages of any transitions configured between those states, as well as the black => white, or white => black theme related changes will be done for you too.
http://www.timmykokke.com/2010/11/using-visual-states-in-custom-controls-in-silverlight/
Update:
In the click handler of one set the background property of the other.
In pseudo-code:
Button button1
ToggleButton button2
Button1.MouseDown:
Set button2 pressed state to true
Button2.MouseUp:
Set button2 pressed state to false
try using MS Expression Blend to customize the behavior, details

Categories

Resources