Post: [VB]A compilation of programs to Build+Helpful scripts
02-19-2011, 11:35 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); I put together some Video tutorials, and common/useful scripts for the Visual Basic Programming Language.

Included:

  • Spammer(Commonly used for MSN, works with any program that accepts text).
  • Temperature Converter
  • HTML Tester
  • Generate a selected code via clicking any function(Label, Button, etc.(Kind of like what a Code Finder Does)).
  • Useful codes that can be used in any situation.


More tutorials coming soon=D

[multipage=Spammer]


Prerequisites:

  • 2 Buttons
  • 1 Textbox


Source Code:
    Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = False
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
SendKeys.Send(TextBox1.Text)
SendKeys.Send("{Enter}")
End Sub
End Class


[multipage=Temperature Converter]


Prerequisites:

  • 2 Buttons


Source Code:
    Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim FTemp, Celsius As Single
Dim strFtemp As String
Dim Prompt As String = "Enter a Fahreinheit Temperature and Press Ok"
Do
strFtemp = InputBox(Prompt, "Fahreinheit To Celcius")
If strFtemp <> "" Then
FTemp = CSng(strFtemp)
Celsius = Int((FTemp + 40) * 5 / 9 - 40)
MsgBox(Celsius, , "The Temperature in Celcius is:")
End If
Loop While strFtemp <> ""
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim FTemp, Celsius As Single
Dim strFtemp As String
Dim Prompt As String = "Enter a Celcius Temperature and Press Ok"
Do
strFtemp = InputBox(Prompt, "Celcius To Fahreinheit")
If strFtemp <> "" Then
FTemp = CSng(strFtemp)
Celsius = Int((FTemp * 9 / 5) + 32)
MsgBox(Celsius, , "The Temperature in Fahreinheit is:")
End If
Loop While strFtemp <> ""
End Sub
End Class


[multipage=HTML Tester]


Prerequisites:

  • 4 Buttons
  • 1 Web Browser
  • 1 Rich text box
  • 1 Menu Strip


Source code:
    Public Class Form1

Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click, Button1.Click
Dim Open As New OpenFileDialog
Open.Filter = "HTML.Files (*htm)|*.htm"
If Open.ShowDialog() = Windows.Forms.DialogResult.OK Then
RichTextBox1.LoadFile(Open.FileName)
Else
'Awesome faceo nothing
End If
End Sub

Private Sub SaveToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem.Click, Button2.Click
Dim DlG As New SaveFileDialog
DlG.Filter = "HTML Documents (*.htm)|*.htm"
If DlG.ShowDialog = DialogResult.Yes Then
RichTextBox1.SaveFile(DlG.FileName, RichTextBoxStreamType.RichText)
Else
'Awesome faceo Nothing
End If
End Sub

Private Sub PreviewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PreviewToolStripMenuItem.Click, Button3.Click
WebBrowser1.DocumentText = RichTextBox1.Text
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
WebBrowser1.DocumentText = ""
End Sub
End Class


[multipage=Generate Selected Code]


Prerequisites:

  • At least 1 button
  • At least 1 Textbox
  • 1 Richtextbox


Source Code:
    RichTextBox1.Text = TextBox1.Text


This is again, really good for making code finders, such as when the user clicks a button reading All challenges for mw2, in the richtextbox the script for it will show up. And if you wanted to do just more than one textboxes to have things output from, then just add another textbox, and tie a button, label, etc. what ever you want to it like so:
    Richtextbox1.Text = Textbox2.Text

and so on.

[multipage=Useful Visual Basic Codes]Here are some commonly used visual basic codes to use.
    Process.Start("https://www.url.com")

-Opens web page upon which button it is tied to is clicked.

    MsgBox("Text")

-Displays a message dialog box upon which button it is tied to is clicked.

    TextBox#.Text = Int(Rnd() * 4)
Select Case TextBox#.Text
Case 0
TextBox#.Text = "text"
Case 1
TextBox#.Text = "text"
Case 2
TextBox#.Text = "text"
Case 3
TextBox#.Text = "text"
Case 4
TextBox#.Text = "text"
Case 5
TextBox#.Text = "text"
End Select

-Generates random results, would be ideal if lets say you were going to make a Call of Duty random class generator, and if you want to add more results simply add another case, which in this case would be:
    Case 6
Textbox#.Text = "text"

Except you would change the '#' to the textbox number. And as you see at the top where it says: Int(Rnd() * 4) change that '4' to one number greater than how many Cases you have, so lets say you have 10 cases, you would change it to: Int(Rnd() * 11)


    
Dim [I]NAME[/I] As String
Dim [I]NAME[/I] As Integer
Dim [I]NAME[/I] As New
Dim [I]NAME[/I] As Single

-Declare Variables(That's not all of them, if you know some I don't, please tell meWinky Winky)


    
Dim open As New OpenFileDialog
open.Filter = "TYPE OF FILE (*File Extension)|*.File Extension"
If open.ShowDialog() = Windows.Forms.DialogResult.OK Then
ITEM YOU WANT IT TO LOAD IN.LoadFile(open.FileName)
Else
'Awesome faceo nothing
End If
End Sub

-Creates a dialog box asking you to Open a file.


            
Dim DlG As New SaveFileDialog
DlG.Filter = "FILEtype (*.FILE EXTENSION)|*.FILE EXTENSION"
If DlG.ShowDialog = DialogResult.Yes Then
[B]RichTextBox1[/B].SaveFile(DlG.FileName, [B]RichTextBox[/B]StreamType.[B]RichText[/B])
Else
'Awesome faceo nothing
End If
End Sub

-Saves Files


Well, that's all I could get off the top of my head for these codes, if you got a code to suggest, please do.


[multipage=Outro] Well, that pretty much sums it up:y: If you have any code to suggest for my "Useful Codes List," or a Tutorial you would like to see made, please tell me.
(adsbygoogle = window.adsbygoogle || []).push({});

The following 3 users say thank you to skitterz for this useful post:

Alt, Rath, xrtzx
02-20-2011, 02:05 AM #2
Rath
Today Will Be Different
Originally posted by skitterz View Post
I put together some Video tutorials, and common/useful scripts for the Visual Basic Programming Language.

Included:

  • Spammer(Commonly used for MSN, works with any program that accepts text).
  • Temperature Converter
  • HTML Tester
  • Generate a selected code via clicking any function(Label, Button, etc.(Kind of like what a Code Finder Does)).
  • Useful codes that can be used in any situation.


More tutorials coming soon=D

[multipage=Spammer] You must login or register to view this content.

Prerequisites:

  • 2 Buttons
  • 1 Textbox


Source Code:
    Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = False
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
SendKeys.Send(TextBox1.Text)
SendKeys.Send("{Enter}")
End Sub
End Class


[multipage=Temperature Converter] You must login or register to view this content.

Prerequisites:

  • 2 Buttons


Source Code:
    Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim FTemp, Celsius As Single
Dim strFtemp As String
Dim Prompt As String = "Enter a Fahreinheit Temperature and Press Ok"
Do
strFtemp = InputBox(Prompt, "Fahreinheit To Celcius")
If strFtemp <> "" Then
FTemp = CSng(strFtemp)
Celsius = Int((FTemp + 40) * 5 / 9 - 40)
MsgBox(Celsius, , "The Temperature in Celcius is:")
End If
Loop While strFtemp <> ""
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim FTemp, Celsius As Single
Dim strFtemp As String
Dim Prompt As String = "Enter a Celcius Temperature and Press Ok"
Do
strFtemp = InputBox(Prompt, "Celcius To Fahreinheit")
If strFtemp <> "" Then
FTemp = CSng(strFtemp)
Celsius = Int((FTemp * 9 / 5) + 32)
MsgBox(Celsius, , "The Temperature in Fahreinheit is:")
End If
Loop While strFtemp <> ""
End Sub
End Class


[multipage=HTML Tester] You must login or register to view this content.

Prerequisites:

  • 4 Buttons
  • 1 Web Browser
  • 1 Rich text box
  • 1 Menu Strip


Source code:
    Public Class Form1

Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click, Button1.Click
Dim Open As New OpenFileDialog
Open.Filter = "HTML.Files (*htm)|*.htm"
If Open.ShowDialog() = Windows.Forms.DialogResult.OK Then
RichTextBox1.LoadFile(Open.FileName)
Else
'Awesome faceo nothing
End If
End Sub

Private Sub SaveToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem.Click, Button2.Click
Dim DlG As New SaveFileDialog
DlG.Filter = "HTML Documents (*.htm)|*.htm"
If DlG.ShowDialog = DialogResult.Yes Then
RichTextBox1.SaveFile(DlG.FileName, RichTextBoxStreamType.RichText)
Else
'Awesome faceo Nothing
End If
End Sub

Private Sub PreviewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PreviewToolStripMenuItem.Click, Button3.Click
WebBrowser1.DocumentText = RichTextBox1.Text
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
WebBrowser1.DocumentText = ""
End Sub
End Class


[multipage=Generate Selected Code] You must login or register to view this content.

Prerequisites:

  • At least 1 button
  • At least 1 Textbox
  • 1 Richtextbox


Source Code:
    RichTextBox1.Text = TextBox1.Text


This is again, really good for making code finders, such as when the user clicks a button reading All challenges for mw2, in the richtextbox the script for it will show up. And if you wanted to do just more than one textboxes to have things output from, then just add another textbox, and tie a button, label, etc. what ever you want to it like so:
    Richtextbox1.Text = Textbox2.Text

and so on.

[multipage=Useful Visual Basic Codes]Here are some commonly used visual basic codes to use.
    Process.Start("https://www.url.com")

-Opens web page upon which button it is tied to is clicked.

    MsgBox("Text")

-Displays a message dialog box upon which button it is tied to is clicked.

    TextBox#.Text = Int(Rnd() * 4)
Select Case TextBox#.Text
Case 0
TextBox#.Text = "text"
Case 1
TextBox#.Text = "text"
Case 2
TextBox#.Text = "text"
Case 3
TextBox#.Text = "text"
Case 4
TextBox#.Text = "text"
Case 5
TextBox#.Text = "text"
End Select

-Generates random results, would be ideal if lets say you were going to make a Call of Duty random class generator, and if you want to add more results simply add another case, which in this case would be:
    Case 6
Textbox#.Text = "text"

Except you would change the '#' to the textbox number. And as you see at the top where it says: Int(Rnd() * 4) change that '4' to one number greater than how many Cases you have, so lets say you have 10 cases, you would change it to: Int(Rnd() * 11)


    
Dim [I]NAME[/I] As String
Dim [I]NAME[/I] As Integer
Dim [I]NAME[/I] As New
Dim [I]NAME[/I] As Single

-Declare Variables(That's not all of them, if you know some I don't, please tell meWinky Winky)


    
Dim open As New OpenFileDialog
open.Filter = "TYPE OF FILE (*File Extension)|*.File Extension"
If open.ShowDialog() = Windows.Forms.DialogResult.OK Then
ITEM YOU WANT IT TO LOAD IN.LoadFile(open.FileName)
Else
'Awesome faceo nothing
End If
End Sub

-Creates a dialog box asking you to Open a file.


            
Dim DlG As New SaveFileDialog
DlG.Filter = "FILEtype (*.FILE EXTENSION)|*.FILE EXTENSION"
If DlG.ShowDialog = DialogResult.Yes Then
[B]RichTextBox1[/B].SaveFile(DlG.FileName, [B]RichTextBox[/B]StreamType.[B]RichText[/B])
Else
'Awesome faceo nothing
End If
End Sub

-Saves Files


Well, that's all I could get off the top of my head for these codes, if you got a code to suggest, please do.


[multipage=Outro] Well, that pretty much sums it up:y: If you have any code to suggest for my "Useful Codes List," or a Tutorial you would like to see made, please tell me.


Good job on the thread. Someone is trying to be "Teh Dopey" :carling:
02-20-2011, 10:16 PM #3
AgentKing-Botz
Are you high?
Need some help with the text spammer. I am new to this and am trying to make a text spammer and I did what the video did and the start button won't work and I did the code correctly also :(.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo