How should I show users which fields are compulsory in a windows forms application.
I have considered changing the label color or maybe the background color of the text box.
I use an error provider to show a red exclamation mark next to the field, however this is only visible after they have clicked the save button.
Asterisk or icon to the side of control
Red border when required validation fails (when user tries to save)
Bold Labels
Different background color for required controls (perhaps only when user tries to save)
Use the errorprovider extension control.
This places a red cross next to the control with a tooltip message.
Yellow background would make it similar to many web forms. No idea whether there are any standards for Windows per se, though if there are I doubt they are widely used.
I would use the ErrorProvider control, possibly with a different icon to represent "required" as opposed to "in error". I would also ensure the fields start with error icon shown next to them and the icon should only disappear once data has been provided for that field.
Only doing validation/notification of missing data when the user tries to save seems way too late.
Something to consider is what users are accustomed to seeing for required fields. While not graphically spectacular, placing a simple asterisk next to required field is a very ubiquitous solution.
Related
I am developing an application that requires to load lots of textboxes dynamically. It may vary according to certain conditions. And each one of these textboxes' text is formatted differently: Some of them will have their text in Bold, some of them underlined, and so on. Kind of like a document.
All of these textboxes are included in a flowlayoutpanel, and this flowlayoutpanel's flow is up to down and autoscrollable. So when i scroll down the "document", everything goes blank for some reason, there are white lines and rectangles all over the textboxes and then, the application crashes.
Screenshot of the problem.
Sometimes it might throw a Generic GDI+ error exception, some others an Out of Memory exception. So I decided to try out putting all of these textboxes without the format (just the text with no bold/italic/underlined styling), and it works just fine like that.
My question is: Is there a way to prevent these type of errors without having to remove the format from the text? If not, could there be another approach to this?
I'd highly appreciate good feedback on this one.
Thanks in advance.
I don't know if it is okay to ask it here but i hope i can get a good response.
I just want to align the button OK in the right side and also i already change the properties of it to right from default but still when i run my project it stay always in the left side. Did i miss something? Or is there any better way to align my button inside popup menu? can someone help me please.
this is the current output when i run my system.
and you can see that the button okay still in the left side.
Actually there is an TextOptions.HAlignment property which is used by BarButtonItem.Appearance, BarButtonItem.ItemAppearance and BarButtonItem.ItemInMenuAppearance and has values Far,Center,Near. Still, it is not supported in all cases (as it is referred in Note section of the link) and I'm afraid the popupmenu is one of them, because it cannot be found in Designer, you can access it only by code. Also all my tries to change the value of property had no effect in caption alignment. My proposal is to add empty space in your caption in order to bring it to center, supposed your menu width will stay the same
I am working on an autocomplete search box in a Windows 8 app. The box needs to allow typing and then have text show up beyond the cursor, in a different color.
Our current approach is to layer one textbox on top of the other, but it seems to me like there could be a better way.
On iOS/Mac I could do this with an NSAttributedString, but I don't know if an equivalent like that exists on WinRT/.NET.
(For those that don't know, an NSAttributedString is a string that allows you to set attributes like color or size on different sections)
I usually approach that by auto-completing the text and marking the completed part as selected, so when the user continues typing - the selected part gets replaced by typed in characters. I doubt this will give you the specific visual effect - with no highlight, but changed text color, but I'd claim this is the only feasible and reliable solution.
This is my first tryst with C#. The form that i have in mind consists
A textfield which will be supplied with the path of an executable.
A "Run" button which will call the executable(cosole app)
The executable console output should be displayed in the rich textbox.
Now when i click on a line in richtext box, i select and get the text in the line. This text maps to some other text info. I need to display this text info as a tooltip over the line.
More explanation:
The output of the exe is displayed in the text box as
Address1=Value
Address2=Value
Now when i click the line "Address1=Value", i map this text to find some info regarding what bits are set like
enable : 1
select : 0 ..etc
this info i need to display as tooltip over the line. Is such a thing possible? Is there better alternative to RTB/tooltip for this problem?
Thanks
Vivek
I would recommend using a ListBox for each string of data returned and then if you use a tooltip it makes alot more sense because you are hovering over a list item specifically not the whole text field.
Using the ListBox and items should make it alot easier to work with overall since it will be separating them into defined items instead of just appending lines to a text box.
Also I think you might have alot of work in store for you for trying to make the text box behave the way you want it to for it to treat each line differently dependent on the text of the line.
If you're using the textbox because later you want to be able to select all the output to copy and paste it I would have the textbox hidden by default and have a button that says like "Toggle Raw Output" that will show/hide the text field so users can get the text easily. While using the ListBox as the primary display for information.
What I understand from your question is that when you click on the line in the RTB, your code scans the text on that line, identifies the extra data associated with that line and then inserts it into the tooltip for the RTB.
Technically I believe that this is possible to do - although I am not 100% sure of the mechanics of inserting tooltip text. However as a user interface feature I would personally not do that as the tooltip text is displayed whenever the mouse pointer is anywhere over the RTB. Thus if a user clicks on line #1, (and sees the data associated from line #1) but hovers the mouse of line #3, they might think that the tooltip is associated with line #3.
You could alleviate my concerns with a strongly worded tooltip, but I feel that what you are doing is misusing the tooltip for something other than what it was intended to be used for. IMHO it may be that you are better off displaying your data with a tree control rather than with a RTB, as the tree control more naturally expresses the functionality that you desire (click on a node, expand it to see details etc).
I'm currently creating a WPF Exception Window, much in the style of the MessageBox (static show methods). In attempting to Style it similarly, I have created an ExceptionWindowOptions enum which contains the value, RightAlign.
When the RightAlign flag is tagged in the MessageBox class, the window title is aligned to the right (next to the control box (minimize, max, close)), so i'm attempting to emulate this behaviour.
I have investigated as much as possible and I cannot find a WPF solution.
I am familiar with interop with native methods as I am using GetWindowLong and SetWindowLong for the RtlReading option, but I haven't managed to find anything to change the location of the window title.
Any help is appreciated.
Take a look on FluidKit library from Pavan Podila. Particularly, you may be interested in GlassWindow. The main idea here is that you override window style from scratch. Sure, this requires you to customize style for different themes, but at least it's a solution, if you don't find anything else.
I believe that you want to set Window.FlowDirection. That will set it for all content in the window however, including buttons, text boxes, etc, so if you ONLY want to make the title bar RTL, you could then have the window contain a panel which would reset it to LTR (or whatever).
Ack- on testing this, maybe not. It looks like it RTL's ALL of the title bar, including the control box and the icon!