What's new

A Bunch Of VB Codes

Brinko

Brinko

Retired & VIP HypeMan.
VIP
Retired
Fabled Veteran MotM Jokester
Messages
9,545
Reaction score
4,856
Points
1,260
Sin$
0
Brinko54 VB Codes
I will update when i can

-------------------------------------------------------------------------------------------------------
Avatar Viewer
Code:
(Search Button)

Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
PictureBox2.ImageLocation = "http://avatar.xboxlive.com/avatar/" + TextBox1.Text + "/avatarpic-l.png"
PictureBox1.ImageLocation = "http://avatar.xboxlive.com/avatar/" + TextBox1.Text + "/avatar-body.png"
PictureBox3.ImageLocation = "http://card.mygamercard.net/" + TextBox1.Text + ".png"
End Sub

(Text Box)

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If TextBox1.Text = ("Admin") Then StyleManager1.ManagerStyle = eStyle.Office2007VistaGlass
End Sub

(Save Avatar Button)

Private Sub ButtonX2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX2.Click
Dim SaveFileDialog1 As New SaveFileDialog
SaveFileDialog1.Title = "Save Avatar As..."
SaveFileDialog1.Filter = "PNG|.png|JPEG|*.jpg|GIF|*.gif"
If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim ImageFormatToUse As Imaging.ImageFormat = Imaging.ImageFormat.Png
If SaveFileDialog1.FilterIndex = 0 Then ImageFormatToUse = Imaging.ImageFormat.Png
If SaveFileDialog1.FilterIndex = 1 Then ImageFormatToUse = Imaging.ImageFormat.Jpeg
If SaveFileDialog1.FilterIndex = 2 Then ImageFormatToUse = Imaging.ImageFormat.Gif
PictureBox1.Image.Save(SaveFileDialog1.FileName, ImageFormatToUse)
End If
End Sub

(Save Gamer Picture Button)

Private Sub ButtonX3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX3.Click
Dim SaveFileDialog2 As New SaveFileDialog
SaveFileDialog2.Title = "Save Gamer Picture As..."
SaveFileDialog2.Filter = "PNG|.png|JPEG|*.jpg|GIF|*.gif"
If SaveFileDialog2.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim ImageFormatToUse As Imaging.ImageFormat = Imaging.ImageFormat.Png
If SaveFileDialog2.FilterIndex = 0 Then ImageFormatToUse = Imaging.ImageFormat.Png
If SaveFileDialog2.FilterIndex = 1 Then ImageFormatToUse = Imaging.ImageFormat.Jpeg
If SaveFileDialog2.FilterIndex = 2 Then ImageFormatToUse = Imaging.ImageFormat.Gif
PictureBox2.Image.Save(SaveFileDialog2.FileName, ImageFormatToUse)
End If
End Sub

(Save gamercard Button)

Private Sub ButtonX4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX4.Click
Dim SaveFileDialog3 As New SaveFileDialog
SaveFileDialog3.Title = "Save Gamercard As..."
SaveFileDialog3.Filter = "PNG|.png|JPEG|*.jpg|GIF|*.gif"
If SaveFileDialog3.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim ImageFormatToUse As Imaging.ImageFormat = Imaging.ImageFormat.Png
If SaveFileDialog3.FilterIndex = 0 Then ImageFormatToUse = Imaging.ImageFormat.Png
If SaveFileDialog3.FilterIndex = 1 Then ImageFormatToUse = Imaging.ImageFormat.Jpeg
If SaveFileDialog3.FilterIndex = 2 Then ImageFormatToUse = Imaging.ImageFormat.Gif
PictureBox3.Image.Save(SaveFileDialog3.FileName, ImageFormatToUse)
End If
End Sub
End Class



Some Basic Codes
Code:
----------------------------------------------------------

Speech thing


Dim Speech
Speech = CreateObject("sapi.spvoice")
Speech.speak(TextBox1.Text)



----------------------------------------------------------

HyperLinks Thing


Process.Start("http://www.SITE.com")


----------------------------------------------------------

MessageBox Thing


MsgBox("MESSAGE")



-----------------------------------------------------------

Show/Hide Another Form


Show - FORMNAME.Show()

Hide - Me.Hide()

------------------------------------------------------------

Fake Keygen Code


TextBox1.Text = Int(Rnd() * 7)
Select Case TextBox1.Text
Case 0
TextBox1.Text = "D4HG5-E2N5E-3XV4K-U78B5-GF4V1"
Case 1
TextBox1.Text = "GF4N1-HTG52-54HTG-78HFG-VD457"
Case 2
TextBox1.Text = "T895Y-12BGH-WE5B5-MN4D5-TJ5VB"
Case 3
TextBox1.Text = "CA4DD-EG5DF-QW5B4-BVG4F-FDG4G"
Case 4
TextBox1.Text = "VFU84-HJK55-FHGD7-BVFR4-OU5M1"
Case 5
TextBox1.Text = "QWEC4-BV4R5-T54B2-QVB5G-BV125"
Case 6
TextBox1.Text = "C54HG-WRBG5-TTYH8-NBHY5-TYMN5"
Case 7
TextBox1.Text = "BGT45-KJ5Y7-BDGN4-ER587-GHH45"
End Select
End Sub

-----------------------------------------------------------------------------



Sending Text To A Text Box From Button


TextBox1.Text = "Hi!"

--------------------------------------------------------------------------------



Opening Up A programme With Button
Code:
System.Diagnostics.Process.Start("\PATH HERE")
or
System.Diagnostics.Process.Start("C:\PATH HERE")
 
Zimee

Zimee

Contributor
Messages
3,323
Reaction score
768
Points
375
Sin$
0
I know the codes are similar, but are they the same for REALbasic?
 
O

OpticNation

7s Addict
Messages
1,277
Reaction score
66
Points
160
Sin$
0
thanks for this keep updaing :biggrin: this will really come in handy for alot of peeps
 
The Aviator

Aviator

ლ(ಠ益ಠლ)
Hardened Veteran Experienced Veteran Grizzled Veteran
Messages
1,813
Reaction score
252
Points
305
Sin$
7
Dude, I just peed myself (not really)... This is just what I was looking for!
+Rep.
 
Chris7S

InModWeTrust360

Nerd by definition, programmer by trade
Grammar Nazi Chatty Kathy Seasoned Veteran
Messages
1,506
Reaction score
490
Points
515
Sin$
7
I use this code here to try and save a web browser:
Code:
Private Sub ButtonX2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX2.Click 
Dim SaveFileDialog1 As New SaveFileDialog 
SaveFileDialog1.Title = "Save Avatar As..." 
SaveFileDialog1.Filter = "PNG|.png|JPEG|*.jpg|GIF|*.gif" 
If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then 
Dim ImageFormatToUse As Imaging.ImageFormat = Imaging.ImageFormat.Png 
If SaveFileDialog1.FilterIndex = 0 Then ImageFormatToUse = Imaging.ImageFormat.Png 
If SaveFileDialog1.FilterIndex = 1 Then ImageFormatToUse = Imaging.ImageFormat.Jpeg 
If SaveFileDialog1.FilterIndex = 2 Then ImageFormatToUse = Imaging.ImageFormat.Gif 
PictureBox1.Image.Save(SaveFileDialog1.FileName, ImageFormatToUse) 
End If 
End Sub

And get this error:
Code:
Object reference not set to an instance of an object.

Any help or ideas?
 
Brinko

Brinko

Retired & VIP HypeMan.
VIP
Retired
Fabled Veteran MotM Jokester
Messages
9,545
Reaction score
4,856
Points
1,260
Sin$
0
I use this code here to try and save a web browser:
Code:
Private Sub ButtonX2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX2.Click 
Dim SaveFileDialog1 As New SaveFileDialog 
SaveFileDialog1.Title = "Save Avatar As..." 
SaveFileDialog1.Filter = "PNG|.png|JPEG|*.jpg|GIF|*.gif" 
If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then 
Dim ImageFormatToUse As Imaging.ImageFormat = Imaging.ImageFormat.Png 
If SaveFileDialog1.FilterIndex = 0 Then ImageFormatToUse = Imaging.ImageFormat.Png 
If SaveFileDialog1.FilterIndex = 1 Then ImageFormatToUse = Imaging.ImageFormat.Jpeg 
If SaveFileDialog1.FilterIndex = 2 Then ImageFormatToUse = Imaging.ImageFormat.Gif 
PictureBox1.Image.Save(SaveFileDialog1.FileName, ImageFormatToUse) 
End If 
End Sub

And get this error:
Code:
Object reference not set to an instance of an object.

Any help or ideas?


Not too sure sorry bro, as i thought it only works for avatar viewers
 
Top Bottom
Login
Register