Is it possible to create a button with WinForms which has the text "Details" and then a down arrow next to it.
It is not vital to my program but I personally think it looks nicer for the user, especially in dialog boxes which expand to show more error details.
The below code will give your Button the word "Details" with an arrow pointing downwards next to it.
Button1.Text = "Details " + char.ConvertFromUtf32(8595);
It sounds like you are asking about the contents of the button itself and want to handle the expand/collaspe functionality yourself. You could create a png with the "down arrow" image, and then position the icon right-middle using the image property of button in the designer.
Related
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
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
I've been fiddling with a property of a control in Windows Forms, and suddenly, I don't know how, I clicked something in the Properties Panel, and all the text in the panel got aligned to the right. I have a picture here to show you. I am stuck with this panel, and it is really annoying. Could you please help me? Thank you so much!
It looks like you have Right-to-Left reading order enabled. To fix it, find a text box in the properties window that you can enter free text (like where you would enter the ID/Name for a control). Right click in the text box, and uncheck "Right to left Reading order":
Remember the good old key stroke: "CTRL + Z" It will take you right back!
enter image description here
Right Click on the text Property textbox there is a option to change it !
Ok so I am trying to do something extremely simple but its turning out to be extremely complicated. I wanted to be able to select my text for all of my labels. Since you can't do that I had to convert them all to textbox's. Now that I have that done I want the user to be able to drag their mouse across an area on the form and select whatever text they roll over. A good example would be a web browser.
EDIT
Ok I need to make this a little more clear and what better than some imagery.
Look at the picture above. I cannot drag my mouse across the form to select the text. I have to click inside the TextBox and then I can only select the data that is inside that specific field. I just want to be able to click and drag my mouse over whatever textbox is in my area of selection.
have you "set its BorderStyle to none and set the background color to the color of your form. Also don't forget to set the readonly property to false"
from http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/5ac4267d-2642-4d05-ae84-1562bf16d068/
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