At the start - i'm starting with windows forms/making desktop applications.
So, I'm moving my program from javascript to c# - desktop app, with full user interface and etc. and I have 2 questions:
I added textbox, and checkbox, it looks good until I highlight the text or it also looks good only if the background behind the app is white in every other case it looks like that, here the image :
How can i fix that?
2nd question:
I had the issue with the texboxes - the borders were invisible and when i clicked them windows was focusing on the app behind my program. I fixed it with changing border from "fixed3D" to "fixedSingle", I also had the same issue with the listbox (under the texboxes) also changed the border to "fixedSingle", but it's loosing now focus when i click the text inside this. How can i solve that? + maybe make the program to not hightlight the text on click in listbox? - it looks better without it
Related
I'm working on a UWP app and I'm having some trouble with the visual states of some UI controls, specifically with buttons and toggle buttons.
Basically, I'd like the borders that become visible when you press the TAB key (to navigate using the keyboard) to have the same ZIndex of the rest of the control, ie. if part of the control is covered, they should be covered too in the same way. But, it looks like these borders are always displayed on top of the UI, no matter what. Here's a screen:
You can see the border going over the rest of the UI, while the rest of that toggle button is correctly covered. The same happens for buttons as well (not only toggle buttons), see here:
I've looked at the template for these controls, but I couldn't find anything related to these specific borders, nor to anything like an explicit Canvas.ZIndex setting or something like that.
I guess this behavior is on purpose, but is there a way to change this and make those borders behave like the rest of the UI?
Thanks!
EDIT: here you can see how a reveal highlight effect is correctly covered by the shadow and the other UI elements on the right, but the TAB border ignores that and is displayed on top of them.
I have noticed similar behavior was previously present in the Start menu as well (although it wasn't with focus border, but with the reveal effect clearly "continuing" into the cut-off portion of the button.
One workaround that comes to mind is to observe the state of the SplitView and when it is closed to actually change the width of the buttons (for example via a StateTrigger). This way the button's area will no longer be "hidden" and the focus border will work properly, as the buttons will end where they should.
I need to create custom button. This will be circle with rings, each ring is separate button. Button text will be displayed on rings. Bellow you can find image how button will looks.
http://imageshack.us/photo/my-images/90/ringbutton.png
I would like to know if it is possible to create this kind of button using VS and WPF.
Do I need third party libraries?
Any examples of similar buttons?
As I written before I had put different size circle buttons one over another and is working like dream. But still I can't display some text on created "rings".
I had use path to display text on rings but is complicated (for me) and text cover button so I can't click where text is.
Any ideas?
You could just put the image on your form and implement a Click() event. It's really not that different from a "real" button.
I am currently working on a windows form application (C# visual studio).
Is it possible to grey out the entire windows screen when a button is pressed?
How can I work that out?
Is it also possible to grey out the entire screen but leaving an ungreyed space in the middle for a message box for showing some text?
Answers to your question:
Is it possible to grey out the entire windows screen when a button is
pressed?
You can put a control like a panel over the entire window and hide it.
In the button event you then make it visible. Set the background of the panel to gray and vary the transparency to adjust it so until your window visibility beneath it looks right.
This will force the window into a "modal mode" without any way out. So you better have logic for undoing this as well.
How can I work that out?
Make sure you have some event such as completion of an event or query to hide the control or the user will never get back into your application again.
Is it also possible to grey out the entire screen but leaving an
ungreyed space in the middle for a message box for showing some text?
That is more complex and to be honest with you I haven't played with WinForm is some time -- instead doing WPF for desktop. You MAY be able to use clipping but you will have to do quite a bit of research into how to do it. Use Google -- it can be your best friend.
easiest way:use XAML pop-up as described below
<Popup x:Name="pop" IsOpen="False" >
</Popup>
For more details visit below link. http://www.c-sharpcorner.com/UploadFile/mahesh/using-xaml-popup-in-wpf/
After this to blur the main grid on eventhandler for the event which shows the pop-up,set the opacity as shown in below C# code
if (pop.IsOpen == false)
{
pop.IsOpen = true;
grdMain.Opacity = 0.4;
}
else
{
pop.isopen=false;
}
I have an image, And I want to create an effect like Windows 8 start menu when user clicks on it.
I mean, if this is my image:
When user clicks on it, it should change to something like this:
I mean, a little 3D effect.
How to create this effect in code behind? (On MouseDown event)
As you requested I'm posting my answer again:
Solution to your issue is covered by another SO question:
C#/WPF image transformation over a trapezoid
Hope this time it wont be automatically converted to comment :)
I would like the same tool tip message (the one entered in the "ToolTip on myControlId" field) to be displayed when the mouse is hovered over an area which contains multiple controls. I tried putting the controls inside a Panel and GroupBox, but it only works when the mouse is in the "white space" area of the Panel/GroupBox, and, of course, does not work when the mouse is on a control within the Panel/GroupBox.
I'm from the web dev world so I'm open to suggestions for a new approach if I'm going about this the wrong way.
In standart windows developmern (WindowsForms) tootltip or tooltip control is associated to a single control. But you can use ToolTip control (see example how: ToolTip: Windows Forms .NET) and assign to all controls that recieve mouseover event.
If you're in WPF, the story becomes easier as you have message routing so usually it's enought to have subscription in one place.
Hope this helps.