VB - Simple Pelican Crossing
Programming
|
Simple Pelican Crossing
Specification;
Rename the form frmPelican in Solution Explorer. Label the form Lights.
Add a picture box. Set MinimumSize to 50, 50 and MaximumSize to 50, 50.
Set the Border style to Fixed3D.
Copy it and paste it twice.
Label them from the top; picRed, picAmber and picGreen.
Add a text box. Label it txtWait. Set MiniumSize to 50, 30 and MaximumSize to 50, 30. Set the Text to WAIT and the font MS Sans 10 point, Bold.
Add a button and label it cmdCross. Set MiniumSize to 50, 25 and MaxiumSize to 50, 25.
Add a timer. Label it tmrTime. Set the interval to 1000 (= 1 Second) and Enabled to False.
This is the code.
Operation;
Code
'Double click the form to access the Private Sub frmPelican_Load event.
Private Sub frmPelican_Load
'Click above it to add to Public Class frmPelican section
Public Class frmPelican
'Add a global integer variable intTime and a Boolean variable binPressed
'Global variables to hold the time in sec... View In Full
 |
0 Comments |
5.00 out of 10 |
|
|
VB - Clock
Programming
|
Clock
Objective;
Create a form that show's the current Time.
Specification;
Set up a form as a clock with a textbox.
Rename the Form1.vb to frmClock. Set the title to "Clock", the BackColor to system Desktop, the ForeColor system ForeColor and the Font to Arial 16.
Set the textbox name to txtTime.
Add a timer and rename it to tmrTimer, set its interval to 1000, and Enabled to "True".
Double click the tmrTimer_Tick code.
Enter this code.
Operation;
Code
Dim timTime As Date
timTime = My.Computer.Clock.GmtTime
Me.txtTime.Text = timTimer.Hour & ":" & timTime.Minute & ":" & timTime.Second
I hoped this helped you in learning VB,
There will be more out. Check my profile for more post's. View In Full
 |
0 Comments |
1.00 out of 10 |
|
|
VB - Hi Bye
Programming
|
Hi Bye
Objective;
Create a form that appears slowly with the message "Hello" until fully opaque. On clicking a button, the message changes to "Bye" and then fades out. When it is invisible it will be closing the form and program.
Specification;
Rename the Form1.vb to frmHiBye. Set the title to "Hi Bye", the BackColor to web Red, the ForeColor to web Gold and the Font to BauHaus 10.
Set the Opacity to 0%.
Set the textbox name to "txtHi" and its text property to "Hello".
Set the button name to cmdBye and its text property to "Bye".
Add a timer and rename it tmrTimer, Set its interval to 200, and Enabled to "True".
Double click the form to add the form code, double click the button to enter cmdBye_Click code and double click the timer to enter the tmrTimer_Tick code.
This is the code.
Operation;
Code
Public Class frmHiBye
Public dblTime As Double
Public binClosing As Boolean
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.Ev... View In Full
 |
0 Comments |
5.00 out of 10 |
|
|
VB - Hello Me
Programming
|
Hello Me
Objective;
Create a simple applaction to take the user's name and print a greeting when the button is pressed. The message changes if the user has the expected name.
Specification;
The start form and its component in the solution explorer are to be renamed, "frmHelloMe" and it's text property (Title Bar) set to "Hello You",
Set the BackColor to Desktop, the ForeColor to ControlLight, and the Font to Bold,
Set the MaximizeSize to 350, 300 and the StartPosition to CenterScreen,
Set the MaximizeBox and MinimizeBox to "False".
The first textbox is to be named txtName and its text property set to, "Please Enter Your Name (Or a similar instruction),
The second textbox is to be named "txtWelcome" and it's text property left blank,
The first command button is to be named "cmdWelcome" and it's text property set to "Hello",
Add a second command button is to be named "cmdExit" and labelled Exit in the bottom right and corner of your form,
The design is to be saved as "H... View In Full
 |
0 Comments |
5.00 out of 10 |
|
|
VB - Hello
Programming
|
Hello
Objective;
Create a simple applaction to request the user's name and print a greeting when the button is pressed.
Specification;
The start form and its component in the solution explorer are to be renamed, "frmHello" and it's text property (Title Bar) set to "Hello".
The first textbox is to be named "txtName" and it's text property set to, "Please Enter You Name (Or a similar instruction)
The second textbox is to be named "txtWelcome" and it's property left to blank.
The command button is to be named "cmdWelcome" and it's text property set to "Hello"
The design can be saved as anything i saved it as Hello.
Operation;
When the Hello button is clicked...
Code;
'A local variable strName should be declared as a String.
Dim strName As String
'The text property of txtName should be passed to this using
strName = txtName.Text
'The text property of txtWelcome should be set to a greeting and the user's name
txtWelcome.Text = "Hello " &... View In Full
 |
0 Comments |
4.00 out of 10 |
|
|
|
 |
|
United Kingdom, South Yorkshire |
|
|
Padrone has 0 fans
become a fan |
|
 |
|
|
 |
|