Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.IO
- Public Class Form1
- Dim FILE_NAME As String = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\savetext.txt"
- Dim PRESETS As String = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\presets.txt"
- Dim COLOR As Boolean
- Dim EFFECT As Boolean
- Dim EFFECT2 As Boolean
- Dim MOVEMENT As Boolean
- Dim EffectSet1 As String
- Dim EffectSet2 As String
- Dim EffectConvert1 As String
- Dim EffectConvert2 As String
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- If TextBox1.Text = "" Then
- MsgBox("You must type something in to send something.")
- Else
- Timer1.Start()
- Button1.Enabled = False
- Button2.Enabled = True
- TextBox1.Enabled = False
- ToolStripStatusLabel2.Text = "Active"
- End If
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- Timer1.Stop()
- Button1.Enabled = True
- Button2.Enabled = False
- TextBox1.Enabled = True
- ToolStripStatusLabel2.Text = "Inactive"
- End Sub
- Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
- SendKeys.Send(EffectConvert1 + EffectConvert2 + TextBox1.Text)
- SendKeys.Send("{Enter}")
- End Sub
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- If System.IO.File.Exists(FILE_NAME) = True Then
- System.IO.File.Delete(FILE_NAME)
- End If
- Dim Text As String = TextBox1.Text
- Dim objWriter As New System.IO.StreamWriter(FILE_NAME, True)
- objWriter.WriteLine(Text)
- objWriter.Close()
- End Sub
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- If System.IO.File.Exists(FILE_NAME) = True Then
- Using sr As New StreamReader(FILE_NAME)
- Dim line As String
- line = sr.ReadToEnd()
- TextBox1.Text = line
- End Using
- End If
- If System.IO.File.Exists(PRESETS) = True Then
- Using r As New StreamReader(PRESETS)
- While (r.Peek() > -1)
- ListBox1.Items.Add(r.ReadLine)
- End While
- r.Close()
- End Using
- End If
- End Sub
- Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
- If Not TextBox1.Text = "" Then
- ListBox1.Items.Add(TextBox1.Text)
- Else
- MsgBox("You must type something to set as a preset.")
- End If
- End Sub
- Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
- ListBox1.Items.Remove(ListBox1.SelectedItem)
- End Sub
- Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
- If Not ListBox1.SelectedItem = "" Then
- Button4.Enabled = True
- Else
- Button2.Enabled = False
- End If
- End Sub
- Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
- TextBox1.Text = ListBox1.SelectedItem
- End Sub
- Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
- If Not ComboBox1.Text = "None" Then
- COLOR = True
- EFFECT = False
- EFFECT2 = False
- EffectSet1 = ComboBox1.Text
- ComboBox4.Text = "None"
- ComboBox2.Text = "None"
- End If
- If ComboBox1.Text = "None" Then
- COLOR = False
- If EFFECT = False And EFFECT2 = False Then
- EffectSet1 = ""
- End If
- End If
- End Sub
- Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
- If Not ComboBox2.Text = "None" Then
- COLOR = False
- EFFECT = True
- EFFECT2 = False
- EffectSet1 = ComboBox2.Text
- ComboBox1.Text = "None"
- ComboBox4.Text = "None"
- End If
- If ComboBox2.Text = "None" Then
- EFFECT = False
- If COLOR = False And EFFECT2 = False Then
- EffectSet1 = ""
- End If
- End If
- End Sub
- Private Sub ComboBox3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox3.SelectedIndexChanged
- If Not ComboBox3.Text = "None" Then
- MOVEMENT = True
- EffectSet2 = ComboBox3.Text
- End If
- If ComboBox3.Text = "None" Then
- MOVEMENT = False
- EffectSet2 = ""
- End If
- End Sub
- Private Sub ComboBox4_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox4.SelectedIndexChanged
- If Not ComboBox4.Text = "None" Then
- COLOR = False
- EFFECT = False
- EFFECT2 = True
- EffectSet1 = ComboBox4.Text
- ComboBox1.Text = "None"
- ComboBox2.Text = "None"
- End If
- If ComboBox4.Text = "None" Then
- EFFECT2 = False
- If COLOR = False And EFFECT = False Then
- EffectSet1 = ""
- End If
- End If
- End Sub
- Private Sub Timer2_Tick_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
- If ComboBox1.Text = "None" Then
- COLOR = False
- End If
- If ComboBox2.Text = "None" Then
- EFFECT = False
- End If
- If ComboBox4.Text = "None" Then
- EFFECT2 = False
- End If
- If ComboBox3.Text = "None" Then
- MOVEMENT = False
- End If
- If COLOR = True Then
- If EffectSet1 = "White" Then
- EffectConvert1 = "white:"
- End If
- If EffectSet1 = "Red" Then
- EffectConvert1 = "red:"
- End If
- If EffectSet1 = "Purple" Then
- EffectConvert1 = "purple:"
- End If
- If EffectSet1 = "Green" Then
- EffectConvert1 = "green:"
- End If
- If EffectSet1 = "Cyan" Then
- EffectConvert1 = "cyan:"
- End If
- End If
- If EFFECT = True Then
- If EffectSet1 = "Glow 1" Then
- EffectConvert1 = "glow1:"
- End If
- If EffectSet1 = "Glow 2" Then
- EffectConvert1 = "glow2:"
- End If
- If EffectSet1 = "Glow 3" Then
- EffectConvert1 = "glow3:"
- End If
- End If
- If EFFECT2 = True Then
- If EffectSet1 = "Flash 1" Then
- EffectConvert1 = "flash1:"
- End If
- If EffectSet1 = "Flash 2" Then
- EffectConvert1 = "flash2:"
- End If
- If EffectSet1 = "Flash 3" Then
- EffectConvert1 = "flash3:"
- End If
- End If
- If MOVEMENT = True Then
- If EffectSet2 = "Wave" Then
- EffectConvert2 = "wave:"
- End If
- If EffectSet2 = "Slide" Then
- EffectConvert2 = "slide:"
- End If
- If EffectSet2 = "Shake" Then
- EffectConvert2 = "shake:"
- End If
- If EffectSet2 = "Scroll" Then
- EffectConvert2 = "scroll:"
- End If
- If EffectSet2 = "Wave 2" Then
- EffectConvert2 = "wave2:"
- End If
- End If
- End Sub
- Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
- If System.IO.File.Exists(PRESETS) = True Then
- System.IO.File.Delete(PRESETS)
- End If
- Dim i As Integer
- Dim objWriter As New System.IO.StreamWriter(PRESETS, True)
- For i = 0 To ListBox1.Items.Count - 1
- objWriter.WriteLine(ListBox1.Items.Item(i))
- Next
- objWriter.Close()
- End Sub
- Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
- If System.IO.File.Exists(PRESETS) = True Then
- System.IO.File.Delete(PRESETS)
- Else
- MsgBox("You haven't saved anything!")
- End If
- End Sub
- Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
- If System.IO.File.Exists(FILE_NAME) = True Then
- System.IO.File.Delete(FILE_NAME)
- Else
- MsgBox("You haven't saved anything!")
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement