VB.net 2010 Msgbox builder with stub

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
13 posts Page 1 of 2
Contributors
User avatar
AnoPem
VIP - Donator
VIP - Donator
Posts: 441
Joined: Sat Jul 24, 2010 10:55 pm

VB.net 2010 Msgbox builder with stub
AnoPem
This tutorial is how you create a msgbox builder with stub
First we gonna build the stub
Create a new form project
1. Double click on form1

Form1.Load
Code: Select all
        Me.Height = 0
        Me.Width = 0
        Me.Opacity = 0
        Me.Hide()
        Me.Visible = False
        Me.ShowInTaskbar = False
        Me.ShowIcon = False
        Dim msgtitle, msgbody As String
        Dim Critical, information, yesno, exclamation As Boolean
        Dim BinText As String = IO.File.ReadAllText(Application.ExecutablePath)
        If BinText.Contains("FileSpilt") = False Then Exit Sub
        Dim ArrContents() As String = Split(BinText, "FileSpilt")
        msgtitle = ArrContents(1)
        msgbody = ArrContents(2)
        Critical = ArrContents(3)
        information = ArrContents(4)
        yesno = ArrContents(5)
        exclamation = ArrContents(6)

        If Critical = True Then
            MsgBox(msgbody, MsgBoxStyle.Critical, msgtitle)
        ElseIf information = True Then
            MsgBox(msgbody, MsgBoxStyle.Information, msgtitle)
        ElseIf yesno = True Then
            MsgBox(msgbody, MsgBoxStyle.YesNo, msgtitle)
        ElseIf exclamation = True Then
            MsgBox(msgbody, MsgBoxStyle.Exclamation, msgtitle)
        End If
        Me.Close()
        Try
        Catch ex As Exception
        End Try
Now we have the stub we build it.
Now we need the msgbox builder first we need a new project
so create a new form project.
When that is done we need.
1. 3 Buttons
2. 4 Radio buttons
3. 3 textboxes
4. 3 labels

Text in button1 it should be "Test"
Text in button2 should be "Build"
Text in button3 should be "Info"

Rename the 4 radiobuttons to
"Critical" " Information" "YesNo "Exclamation"
And put the text the same as name.

now textbox1 should just keep its name
textbox2 should be named "msgtitle"
and textbox3 should be named msgbody

Put 1 label over msgtitle in the label you write "Title"
put another label over msgbody on that you write "Text"
over textbox1 you put the last label and write "Name" in it

no we need the code

Over Public class form1
Code: Select all
Imports System.IO
Button1
Code: Select all
If Critical.Checked = True Then
            MsgBox(msgbody.Text, MsgBoxStyle.Critical, msgtitle.Text)
        ElseIf Information.Checked = True Then
            MsgBox(msgbody.Text, MsgBoxStyle.Information, msgtitle.Text)
        ElseIf YesNo.Checked = True Then
            MsgBox(msgbody.Text, MsgBoxStyle.YesNo, msgtitle.Text)
        ElseIf Exclamation.Checked = True Then
            MsgBox(msgbody.Text, MsgBoxStyle.Exclamation, msgtitle.Text)
        End If
Button2
Code: Select all
Dim b As Byte() = My.Resources.Stub
        Dim TheFIlePath As String = Application.StartupPath & "\Stub.exe"
        Dim TempFile As System.IO.FileStream = IO.File.Create(TheFIlePath)
        TempFile.Write(b, 0, b.Length)
        TempFile.Close()

        IO.File.Copy(CurDir() & "\stub.exe", CurDir() & "\" + TextBox1.Text + ".exe")
        IO.File.AppendAllText(CurDir() & "\" + TextBox1.Text + ".exe", "FileSpilt" & msgtitle.Text & "FileSpilt" & msgbody.Text & "FileSpilt" & Critical.Checked & "FileSpilt" & Information.Checked & "FileSpilt" & YesNo.Checked & "FileSpilt" & Exclamation.Checked)
        MsgBox("Done!", MsgBoxStyle.Information)
        Process.Start(CurDir)

        System.IO.File.Delete(Application.StartupPath & ("\Stub.exe"))

Button3
Code: Select all
Form2.Show()
now we import the stub we made into the msgbox builder form so go to my project then go to resources tab click ad resouce "add existing file" find the stub.exe
when that is imported into it go to solution explorer and find stub.exe under resources folder click on it and change "none" in build action to embed resource

create a form2 and put some info about it

now build your msgbox builder and it should work with the stub inside it

Please inform me if anything is wrong with the code or anything else

when your done it should look something like this
Image
You do not have the required permissions to view the files attached to this post.
https://t.me/pump_upp
User avatar
zachman61
VIP - Donator
VIP - Donator
Posts: 1892
Joined: Wed Dec 16, 2009 9:56 pm

Looks awesome!
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :)
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

What is this used for?
User avatar
AnoPem
VIP - Donator
VIP - Donator
Posts: 441
Joined: Sat Jul 24, 2010 10:55 pm

mandai wrote:
What is this used for?
It creates a msgbox that popup when you click on the exe file it creates
https://t.me/pump_upp
User avatar
Napster1488
VIP - Donator
VIP - Donator
Posts: 524
Joined: Fri Jan 07, 2011 8:41 pm

Really useless anyway a Msgbox exe Builder but ok,nice code...
YouTube Downloader v3.0
Image
Image
Image
User avatar
Jg99
VIP - Site Partner
VIP - Site Partner
Posts: 453
Joined: Sun Mar 20, 2011 5:04 am

nice code, I will + rep u!
http://www.sctechusa.com SilverCloud Website
User avatar
AnoPem
VIP - Donator
VIP - Donator
Posts: 441
Joined: Sat Jul 24, 2010 10:55 pm

Jg99 wrote:
nice code, I will + rep u!
Thanks
https://t.me/pump_upp
User avatar
shekoasinger
New Member
New Member
Posts: 23
Joined: Sat Dec 04, 2010 9:40 pm

Well done, since u seem good at this, do u know if its possible that I make a program, where a user selects what he wants and a new .exe will be compiled with their desired features. Thanks in advance. 8-)
User avatar
AnoPem
VIP - Donator
VIP - Donator
Posts: 441
Joined: Sat Jul 24, 2010 10:55 pm

shekoasinger wrote:
Well done, since u seem good at this, do u know if its possible that I make a program, where a user selects what he wants and a new .exe will be compiled with their desired features. Thanks in advance. 8-)
Could you explain it a little more ?
https://t.me/pump_upp
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

You can compile applications by using the VBCodeProvider class, check out http://support.microsoft.com/kb/304654
13 posts Page 1 of 2
Return to “Tutorials”