xeloader Creator & Owner
Number of posts : 326 Age : 31 Programming Skill : Programming Languages : VB.net, Java [A little], HTML. Registration date : 2008-07-08
| Subject: [VB.net][Test] Floating Textbox Thu Apr 23, 2009 11:39 am | |
| Hello everyone! This is my first "test", as i call it. I made this section first of all if you want to put your programming skill on a test! My first test to all of you is: Floating TextboxI'm sure you wonder: - What is a floating textbox? Well it is a textbox that floats on top of all windows, so it shouldn't be in your way when you are making a video, a presentation or anything like that! Well, i made this one pretty quick, so it's very basic, and here's my three Proofs that i made it: Picture:Source Code:Form1 - Code:
-
Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Me.Location = Cursor.Position End Sub
Private Sub Form1_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseUp Timer1.Stop() End Sub
Private Sub Form1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown Timer1.Start() End Sub
Private Sub Form1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Click TextBox1.SelectAll() End Sub
Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked MsgBox("Visit for more Useful applications!") End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged If TextBox1.Text = "Close" Then End ElseIf TextBox1.Text = "Options" Then Form2.Show() End If End Sub
Private Sub Form1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDoubleClick Form2.ShowDialog() End Sub End Class Form2 - Code:
-
Public Class Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Close() End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged If CheckBox1.Checked = True Then Form1.TextBox1.BackColor = Color.WhiteSmoke Form1.LinkLabel1.BackColor = Color.WhiteSmoke Form1.TextBox1.ForeColor = Color.Black Else Form1.TextBox1.ForeColor = Color.Black Form1.TextBox1.BackColor = Color.White Form1.LinkLabel1.BackColor = Color.White End If End Sub End Class Info:You can type inside the textbox (ofc xD), you can drag it around. Change if you want it transparent or white. Close it by typing Close, and get the options by typing Options. Download:http://www.megaupload.com/?d=84L6OKF5Now it's your turn! | |
|