Wednesday 23 January 2013

VB.Net GUI Graphic User Interface.

VB.Net GUI Graphic User Interface.

Getting The Basics Done.

Start from Clicking the Sidebar on the left "ToolBars" Find the SubMenu All Windows Forms.
Click "Button"
















Then Drag the button to the form.

Double Click on the Button, The Code Snippet That gets generated will handle the click even for that button.
now we want to type.

MsgBox("Login Event")

' This is a Dummy Event.
' Now Go Back to the Form Designer, By Clicking on View, then Click Designer.
' Now we want to add to Textbox's. Go through the ToolBar and Find "TextBox"
' Now Add Another Textbox Underneath your other Textbox.

Should Look Like This.


















' Go Back To your Code, By View, Code
Up the top of the Page you will see "Public Class Form1"
Underneath that line write this.

Friend Username As String = "Admin"
Friend Password As String = "Pass"

' These are your variables to login.
' Go Back to your Designer.

Double Click on your "Button."

Delete the Dummy Code "MsgBox("Login Event")"

Type this:

If Textbox1.Text = Username And Textbox2.Text = Password Then
MsgBox("Welcome" & Username)
Else
MsgBox("Invalid Password or Username")
End If

now you are done.

No comments:

Post a Comment