Click here to Skip to main content
15,892,839 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Mouse-event Improvement Pin
User 584223718-Apr-09 1:24
User 584223718-Apr-09 1:24 
GeneralRe: Mouse-event Improvement Pin
Eddy Vluggen18-Apr-09 1:33
professionalEddy Vluggen18-Apr-09 1:33 
GeneralRe: Mouse-event Improvement Pin
User 584223718-Apr-09 5:03
User 584223718-Apr-09 5:03 
GeneralRe: Mouse-event Improvement Pin
Eddy Vluggen18-Apr-09 5:52
professionalEddy Vluggen18-Apr-09 5:52 
GeneralRe: Mouse-event Improvement Pin
User 584223718-Apr-09 6:22
User 584223718-Apr-09 6:22 
GeneralRe: Mouse-event Improvement Pin
Eddy Vluggen18-Apr-09 6:50
professionalEddy Vluggen18-Apr-09 6:50 
GeneralRe: Mouse-event Improvement Pin
Mycroft Holmes18-Apr-09 2:03
professionalMycroft Holmes18-Apr-09 2:03 
AnswerRe: Mouse-event Improvement [modified] Pin
Johan Hakkesteegt20-Apr-09 2:39
Johan Hakkesteegt20-Apr-09 2:39 
Here is an alternative solution that lets you put as many controls on your form as you like, without having to write extra lines of code for each:

All you need to do is add a timer and determine an interval to your taste (I just successfully tested with 10 milliseconds, and I have a 5 year old PC).

Public Class Form1

    Dim ne As New Point(Me.Top, Me.Left)
    Dim sw As New Point(Me.Top + Me.Height, Me.Left + Me.Width)

   Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Timer1.Start()
    End Sub

    Private Sub Form1_Move(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Move
        ne = New Point(Me.Top, Me.Left)
        sw = New Point(Me.Top + Me.Height, Me.Left + Me.Width)
    End Sub


    Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
        ne = New Point(Me.Top, Me.Left)
        sw = New Point(Me.Top + Me.Height, Me.Left + Me.Width)
    End Sub

    Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        With Control.MousePosition
            If .X > ne.X And .Y > ne.Y And .X < sw.X And .Y < sw.Y Then
                TextBox1.BackColor = Color.Azure
            Else
                TextBox1.BackColor = Color.White
            End If
        End With
    End Sub

End Class


Now I just whipped this up quickly, and I must admit that after moving and/or resizing the form this does not work smoothly yet, with this code. If you want to use this idea, you may have to work on that.

My advice is free, and you may get what you paid for.

modified on Tuesday, April 21, 2009 2:04 AM

GeneralRe: Mouse-event Improvement Pin
User 584223725-Apr-09 5:45
User 584223725-Apr-09 5:45 
QuestionHow can i create salary format in Textbox ? for example i want create 2000.00 . Pin
pramod251717-Apr-09 19:55
pramod251717-Apr-09 19:55 
AnswerRe: How can i create salary format in Textbox ? for example i want create 2000.00 . Pin
Rajesh Anuhya17-Apr-09 20:08
professionalRajesh Anuhya17-Apr-09 20:08 
AnswerRe: How can i create salary format in Textbox ? for example i want create 2000.00 . Pin
Andy_L_J17-Apr-09 22:16
Andy_L_J17-Apr-09 22:16 
AnswerRe: How can i create salary format in Textbox ? for example i want create 2000.00 . Pin
Johan Hakkesteegt20-Apr-09 1:41
Johan Hakkesteegt20-Apr-09 1:41 
QuestionError in using MemoryStream in VB.Net Pin
Viram Pandey17-Apr-09 3:57
Viram Pandey17-Apr-09 3:57 
AnswerRe: Error in using MemoryStream in VB.Net Pin
Dave Kreskowiak17-Apr-09 4:26
mveDave Kreskowiak17-Apr-09 4:26 
GeneralRe: Error in using MemoryStream in VB.Net Pin
Viram Pandey20-Apr-09 1:37
Viram Pandey20-Apr-09 1:37 
QuestionCertifiacte download Pin
siva45516-Apr-09 23:13
siva45516-Apr-09 23:13 
AnswerRe: Certifiacte download Pin
Dave Kreskowiak17-Apr-09 3:38
mveDave Kreskowiak17-Apr-09 3:38 
QuestionMultithreading Pin
Muhammad Fahim Baloch16-Apr-09 20:58
Muhammad Fahim Baloch16-Apr-09 20:58 
AnswerRe: Multithreading Pin
Johan Hakkesteegt16-Apr-09 21:25
Johan Hakkesteegt16-Apr-09 21:25 
GeneralRe: Multithreading Pin
Muhammad Fahim Baloch17-Apr-09 1:26
Muhammad Fahim Baloch17-Apr-09 1:26 
GeneralRe: Multithreading Pin
Johan Hakkesteegt17-Apr-09 2:04
Johan Hakkesteegt17-Apr-09 2:04 
GeneralRe: Multithreading [modified] Pin
Jay Royall17-Apr-09 2:09
Jay Royall17-Apr-09 2:09 
GeneralRe: Multithreading Pin
Dave Kreskowiak17-Apr-09 3:26
mveDave Kreskowiak17-Apr-09 3:26 
GeneralRe: Multithreading Pin
Jay Royall17-Apr-09 3:30
Jay Royall17-Apr-09 3:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.