Form2.Show()
Me.Hide()
MsgBox = ("YOUR TEXT HERE!")
Form2.Show()
Form2.RichTextBox1.Text = TextBox1.Text
RichTextBox1.Text = TextBox1.Text
Public Class Form1
'First Define all the code items, I'm using two for each method.
Dim example1ComboBox As String
Dim example2ComboBox As String
Dim example3tab As String
Dim example4tab As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' This is where we make the code appear within the text box/define what the above variables will be, your code.
example1ComboBox = "Put line one of code here" & vbNewLine & "Put Line two Here" & vbNewLine & "This is Example 1"
example2ComboBox = "Put line one of code here" & vbNewLine & "Put Line two Here" & vbNewLine & "This is Example 2"
example3tab = "Put line one of code here" & vbNewLine & "Put Line two Here" & vbNewLine & "This is Example 3"
example4tab = "Put line one of code here" & vbNewLine & "Put Line two Here" & vbNewLine & "This is Example 4"
'Using & vbNewLine & between "Text" you can add as many lines of code as you require.
Me.Text = "[VG]Mars is Awesome, He made this because it's not nessecary to use a seperate form for code samples"
'Hiding all the controls that we will use to select and view the code until we need them
ComboBox1.Hide()
RichTextBox1.Hide()
RichTextBox2.Hide()
RichTextBox3.Hide()
TabControl1.Hide()
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
'This is where we make the code appear within the text box if it is selecte from our list.
If ComboBox1.SelectedItem = ComboBox1.Items(0) Then
RichTextBox1.Text = example1ComboBox
ElseIf ComboBox1.SelectedItem = ComboBox1.Items(1) Then
RichTextBox1.Text = example2ComboBox
End If
'It is possible to add as many ElseIf statements as there are pieces of code, but be aware that the first item in your list is 0 not 1 as you would expect.
End Sub
Private Sub TabControl1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabControl1.Click
'This shows the code within the text boxes when a tab is selected, again it is possible to add as many elseif's as there are pieces of code.
'In this case the tab being selected will start with 1 instead of 0 as with the ComboBox control.
If TabControl1.SelectedTab Is TabPage1 Then
RichTextBox3.Text = example3tab
ElseIf TabControl1.SelectedTab Is TabPage2 Then
RichTextBox2.Text = example4tab
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ComboBox1.Show()
RichTextBox1.Show()
RichTextBox2.Show()
RichTextBox3.Show()
TabControl1.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ComboBox1.Hide()
RichTextBox1.Hide()
RichTextBox2.Hide()
RichTextBox3.Hide()
TabControl1.Hide()
End Sub
End Class
Public Class Form1
'First Define all the code items, I'm using two for each method.
Dim example1ComboBox As String
Dim example2ComboBox As String
Dim example3tab As String
Dim example4tab As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' This is where we make the code appear within the text box/define what the above variables will be, your code.
example1ComboBox = "Put line one of code here" & vbNewLine & "Put Line two Here" & vbNewLine & "This is Example 1"
example2ComboBox = "Put line one of code here" & vbNewLine & "Put Line two Here" & vbNewLine & "This is Example 2"
example3tab = "Put line one of code here" & vbNewLine & "Put Line two Here" & vbNewLine & "This is Example 3"
example4tab = "Put line one of code here" & vbNewLine & "Put Line two Here" & vbNewLine & "This is Example 4"
'Using & vbNewLine & between "Text" you can add as many lines of code as you require.
Me.Text = "[VG]Mars is Awesome, He made this because it's not nessecary to use a seperate form for code samples"
'Hiding all the controls that we will use to select and view the code until we need them
ComboBox1.Hide()
RichTextBox1.Hide()
RichTextBox2.Hide()
RichTextBox3.Hide()
TabControl1.Hide()
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
'This is where we make the code appear within the text box if it is selecte from our list.
If ComboBox1.SelectedItem = ComboBox1.Items(0) Then
RichTextBox1.Text = example1ComboBox
ElseIf ComboBox1.SelectedItem = ComboBox1.Items(1) Then
RichTextBox1.Text = example2ComboBox
End If
'It is possible to add as many ElseIf statements as there are pieces of code, but be aware that the first item in your list is 0 not 1 as you would expect.
End Sub
Private Sub TabControl1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabControl1.Click
'This shows the code within the text boxes when a tab is selected, again it is possible to add as many elseif's as there are pieces of code.
'In this case the tab being selected will start with 1 instead of 0 as with the ComboBox control.
If TabControl1.SelectedTab Is TabPage1 Then
RichTextBox3.Text = example3tab
ElseIf TabControl1.SelectedTab Is TabPage2 Then
RichTextBox2.Text = example4tab
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ComboBox1.Show()
RichTextBox1.Show()
RichTextBox2.Show()
RichTextBox3.Show()
TabControl1.Show()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ComboBox1.Hide()
RichTextBox1.Hide()
RichTextBox2.Hide()
RichTextBox3.Hide()
TabControl1.Hide()
End Sub
End Class
Copyright © 2026, NextGenUpdate.
All Rights Reserved.