pair ui design we should be no strangers. I made a few small systems like student management system, computer room charge system, etc. are client mode, of course, our Beef brisket press release system , this is our first time contact with the more formal web system. Now vb.net ui design tips for everyone to do a summary, I hope that our reconstruction or cooperation can help it.
Co-operation when I was responsible for the U - layer, so design here to think of as much as possible "wholeheartedly serve the whole." Because users use The time is to interact with the page, for the system's internal logic design and so will not to understand, this is also the importance of UI Design, the concept of the people to check their own, here only to do some tips.
1 , Prompt box
U layer of the design of the prompt box, we can not be in the popup prompt to the user to see the layer title, the following are some small instances and their corresponding code.
Code:
<span style= "FONT-SIZE:24PX;" >messagebox.show ("Are you sure you want to quit the program?", "hint", Messageboxbuttons.yesno, Messageboxicon.question) </span>
Effect:
Precautions:
This is to say that our general cue box is only a "OK" or "yes" button, in other words, the user does not have the right to choose. However, for this exit program, the user is to choose, this box should appear in "Private Sub form_formclosing", by adding if~else~end if To determine whether to cancel the operation or exit the program close the form. For our vb.net, the event in else should be "E.cancel = True".
Full code Description:
<span style= "FONT-SIZE:24PX;" >ifmessagebox.show ("Are you sure you want to quit the program?", "hint", messageboxbuttons.yesno,messageboxicon.question) = Windows.Forms.DialogResult.Yes Then ' event Elsee. Cancel= TrueEnd If code: MessageBox.Show ("Recharge successfully! "," System Prompt ", MessageBoxButtons.OK, Messageboxicon.asterisk) </span>
Effect:
Code:
<span style= "FONT-SIZE:24PX;" >messagebox.show ("Please enter the card number!") "," System Prompt ", MessageBoxButtons.OK, messageboxicon.warning) </span>
Effect:
Code:
<span style= "FONT-SIZE:24PX;" >messagebox.show ("The user does not exist, please re-enter!", "System Tips", MessageBoxButtons.OK, Messageboxicon.error) </span>
Effect:
Of Course there are many types, you can design according to their own preferences, here to provide a icon Description Table:
2 , Enter Key Response
A text box input is completed, we can use the enter key to respond to the OK button, to do more perfect, it is necessary to each text box to write one of the following code, this is very troublesome, But I have not come up with a better way, if you have any good way, but also want to be generous to enlighten ah!
' <summary> ' enter to respond to the login button ' ' </summary> ' <paramname= ' sender ' ></param> ' <paramname= ' e ' ></param> ' <remarks></remarks> public Sub Txtpassword_ KeyUp (ByVal Senderas Object, ByVal e as KeyEventArgs) Handles txtpassword.keyup ' enter key to enter If E.keycode = keys.ent Er then btnok.performclick () end If End Sub
3 , empty, focus
and, of course, don't forget our clear focus. Empty can call a public method, as follows:
' <summary> ' clears the text box's data ' ' </summary> ' ' <param name= ' frm ' > current form </param> ' <returns> Returns a Boolean value, if true, clears success </returns> ' <remarks></remarks> public Function ClearAll (ByVal frm as Form) as Boolean Dim control as New control for each control in frm. Controls ' traverse all controls in the form if TypeOf control is a TextBox then ' to determine the type of control, if the text box is empty control . Text = "" Else if TypeOf control is Comboboxthen ' determines the type of control, if it is a drop-down list, clear control. Text = "" End If End If Next Return True
Focus is, of course, simple, direct.
<span style= "FONT-SIZE:24PX;" >text.focus () </span>
4 , Control lock
If we make a Text box unavailable, use the property Enable=false directly , but if the entire form C8>text Box is locked, that is not a lot of trouble? Ditto for design.
' <summary> ' traverses all controls in the form, and if not, locks ' </summary> ' <paramname= ' frm ' > Current form </param> ' <returns> return True lock succeeded, return false lock Failure </returns> ' ' <remarks></remarks The > Public Function Locked (ByVal frm as Form) as a Boolean Dim control as New control for each control in frm. Controls ' traverse all controls in the form if TypeOf control is TextBox and then ' determines the control type, if it is a TextBox control . The Enabled = False ' Lock control ElseIf TypeOf controls is Comboboxthen ' determines the type of control, if it is a combo box . Enabled = False ' Lock control end If Next Return True End Function
5 , form font unification
here used a relatively stupid method, that is, in the beginning of the form when the change of its font, so that the control is consistent with the above, that is, each build a new form to be modified once, very troublesome, here also please expert advice Ah!
There are a lot of other people have what you need to welcome to my letter ~
UI Design for VB.net