For this explanation I'll be using batch what this will do is use buttons and text boxes to show to code of some thing you want done for example [button one] say a command [text box one] user types some thing it comes out as echo what ever they typed it can be done like the following:
For this tutorial there's no limit to the buttons you can use it just depends on the amounts of code you want generated. You will how ever need a large text box where the codes will be shown. Buttons for the code and text boxes for user input.(You may require tabs if you wish to have a lot in it)
Let's begin with the text box
Name of largest text box would be Textbox3 and its text would be @echo off
(since it's batch) for scroll bars it should have a vertical scroll bar. Lastly it must be multiline and feel free to change colours.
Next tab page 1 comes
For tab page 1 you may want to put in some buttons (we'll get there) and use labels for credits your text box shouldn't be on either tab page and next to them. You may even want to use a message box to say what ever you down your own neck is on the line.
Tab page 2
For tab page 2 you would want to place group boxes with relevant headings and buttons, next to the buttons may be text boxes if you want to have user input.
Buttons and user input
It would be pretty useless with out buttons to generate code,right? So we start by picking a buttons I'll be giving a few codes then explaining how you'd use your own code:
Copy text in text box
My.Computer.Clipboard.SetText(TextBox3.Text) (this should have your text box name and include .Text)
Clear text box
TextBox3.Text = "@echo off"
Exit
End
Credits and agreement
MessageBox.Show("Coded and designed by you and it's your problem if you mess up")
Ok so let's say you want a user's input with a button code like you don't want to say kill and mention a thousand things,you say kill and place a text box so they can choose what to kill. How this is done is like this
Code:
TextBox3.Text = TextBox3.Text & vbNewLine & "kill " & TextBox1.Text
TextBox1.Text = ""
What the above code does is says what ever is already in the above text box,keep and add a new line then say kill and what ever the user typed in text box 1 then it erases text box one so it looks next,simple right?
Saving
Add a save file dialog and a button then use this code:
Code:
SaveFileDialog1.Filter = "Batch (*.bat)|*.bat|Text (*.txt)|*.txt"
SaveFileDialog1.ShowDialog()
SaveFileDialog1.CheckFileExists = True
SaveFileDialog1.CheckPathExists = True
SaveFileDialog1.AddExtension = SaveFileDialog1.FilterIndex
Changing text box font
Add a font dialog and use this code:
Code:
FontDialog1.ShowDialog()
TextBox3.Font = FontDialog1.Font
Changing the text box colour
Add a color dialog and use this code:
Code:
ColorDialog1.ShowDialog()
TextBox3.ForeColor = ColorDialog1.Color
Keep in mind my main text box is Text box 3 feel free to ask if you have any questions.
No replies to this topic
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









