Mouse Events Don’t Fire if Enable is False

Mouse Events Don’t Fire if Enable is False

MouseMove events don’t occur when the control’s Enabled property is set to False. My method tackles this problem and is useful when you want to display the Tooltips or Notes on the status bar, whether the control is enabled or disabled.If the Enabled property is set to False, the control placed behind the control’s MouseMove event will be fired when you move the cursor on the control. Duplicate code you write in the Command1_MoseMove in the Label1_MouseMove. Now it works even though your Command1 button disabled. Place these controls on Form1:

  • Command1(0), Command1(1)-Command1 is the control array.
  • Label1(0), Label1(1)-Labels set behind the command1.
  • SSPanel1-Acts as status bar.
     Private Sub Form_Load()Dim i As IntegerFor i = 0 To 1	Label1(i).Left = Command1(i).Left	Label1(i).Top = Command1(i).Top	Label1(i).Width = Command1(i).Width	Label1(i).Height = _		Command1(i).Height	Next iCommand1(0).enabled = falseCommand1(0).Tag = "Button to Add"Command1(1).Tag = "Button to Modify"Command1(0).Caption = "&Add"Command1(1).Caption = "&Modify"End SubPrivate Sub Label1_MouseMove(Index As _	Integer, Button As Integer, Shift _	As Integer, X As Single, Y As _	Single)	SSPanel1.Caption = _		Command1(Index).TagEnd SubPrivate Sub Command1_MouseMove(Index _	As Integer, Button As Integer, _	Shift As Integer, X As Single, Y _	As Single)	SSPanel1.Caption = _		Command!(Index).tagEnd Sub
  • Share the Post:
    Heading photo, Metadata.

    What is Metadata?

    What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

    XDR solutions

    The Benefits of Using XDR Solutions

    Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

    AI is revolutionizing fraud detection

    How AI is Revolutionizing Fraud Detection

    Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

    AI innovation

    Companies Leading AI Innovation in 2023

    Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several