0% found this document useful (0 votes)
180 views

Virtual Basic

The document provides code examples for various controls and functions in Visual Basic including message boxes, labels, text boxes, buttons, list boxes, radio buttons, check boxes, menus, tabs, progress bars, timers, conditional statements, loops, subs, functions, and sending emails. It shows how to display text, check conditions, iterate through loops, call subs and functions, and perform other common programming tasks.

Uploaded by

Milan Radojevic
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
180 views

Virtual Basic

The document provides code examples for various controls and functions in Visual Basic including message boxes, labels, text boxes, buttons, list boxes, radio buttons, check boxes, menus, tabs, progress bars, timers, conditional statements, loops, subs, functions, and sending emails. It shows how to display text, check conditions, iterate through loops, call subs and functions, and perform other common programming tasks.

Uploaded by

Milan Radojevic
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

Poruka:

Button
MessageBox.Show("Cao", "Cao za naslov")
Variable:
Button
Dim messagecontent As String = "Variable su do jaja"
MessageBox.Show(messagecontent)
MessageBox.Show(messagecontent, messagecontent)
MessageBox.Show(mynumber)
Dim mynumber As Integer = 10
If:
Label, TextBox, Button(Exec)
Button: Label1.Text = "Ja sam nesto"
If TextBox1.Text = "Ponedeljak" Then
Label1.Text = "Napusis se kurca"
End If
Match Functions:
Button
MessageBox.Show(10+-*/15)
MessageBox.Show("10+15")
ProgresBar
ProgressBar1.Value = ProgressBar1.Value + 10 (Min0 Max100)
ListBox
Dodaj Text Box, Button(Dodaj, Flatsitle-Flat, Listbox
Dodaj: ListBox1.Items.Add(TextBox1.Text)
Radio Button Check Box
If RadioButton1.Checked = True Then
MessageBox.Show("Ti si covek")
Else : RadioButton1.Checked = True
MessageBox.Show("Ti si kurva")
End If
cHECK bOX
If Chexxk Box.Checed=True Then
MessageBox.Show("Volis Harija")
MENU STRIP PADAJUCI MENI PADAJUCI MENI
Tab control, Button, Check list Box,LAbel,Tool Strip
Toll Strip(label konvertujes u drop down button)
Kod za izlaz: Me.Close()
LINKOVANJE FORME:
Form2.Show()
PRIMER IF I ELSE ALI NIKAKO ZA PROTEKCIJU
If TextBox.Text + "pasword123" Then
data.Show()
Else
Messagebox.Show("Wrong pass")
Text to speach
Dim SAPI
SAPI = CreateObject("SAPI.spvoice")
SAPI.Speak(TextBox1.Text)ili
SAPI.Speak("Dobrodosli na moj program")
Splash Screen pre programa ( uradi flash designer, pa ja ubacim)
FOR LOOP
Button
Dim i As Integer = 0
For i = 0 To 10
MessageBox.Show("The value of i is:" & i)
Next
For mora da se zavrsi sa Next
Do while (glupost isto sto i lope samo malo bolje)
DO UNTIL
Dio num As Integer = 1
Do Until num = 5
MessageBox.Show("the value of num is:" & num 1)
num=num +1
SUBS
IZNDAD DUGMETA...
Sub givemessage()
MessageBox.Show("I am cool for using subs")
End Sub
...
Tamo gde je dugme programiranje
Call givemessage()
Functions su isto sto i Sub
Public class
Dim labeltext As String = "funkcije su cool"
Private function changlabeltext()
Return labeltext
Sada kucam u private subu
Label1.Text = changelabeltext ()
NAPREDNI MESSAGE BOX
If MessageBox.Show("Ti nisi Ta", "Taj Nisi Ti", MessageBoxButtons.YesNo, Messag
eBoxIcon.Question) = Windows.Forms.DialogResult.Yes Then
MessageBox.Show("You said yes")
Else
MessageBox.Show("You said no")
End If
CONDITIONAL OPERATOR
Dim num As Integer = 0
If num < 1 Then
MessageBox.Show("True")
Else
MessageBox.Show("Folse")
LOGICAL OPERATORS
2x textbox +button
If TextBox1.Text = "" Or Text.Box2.Text = "" Then
MEssagBox.Show("Popuni polja")
If Textbox1.Text = "prvipass" And TextBox2.Text = "drugipas" Then
Form2.Show
TIMER
1000 je 1sekunda
TextBox.Text = TextBox1.Text +1 U timeru
U buttonu:
Timer1.Starts
Timer1.Interval=1000 Ili Timer1.Interval=TextBox2.Text
2. BUttom
Timer1.Stop
SEND EMAIL
Imports System.Net.Mail (iznad public calass)
Unutar private sub
Dim Mail As New MailMessage
Mail.Subject= "test e mail"
Mail.To.Add("[email protected]")
Mail.From= New MailAddress("[email protected])
Mail.Body = "Ovo je mail"
Dim SNTP As New SmtpClient("sntp.gmail.com")
SNTP.EnableSsl = True
SNTP.Credentials = New System.Net.NetworkCredential("username", "password")
SNTP.Port = "568"
SNTP.Send(Mail)
FTP Upload

You might also like