| | |
pause autoscroll using mousehover
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2008
Posts: 25
Reputation:
Solved Threads: 0
Hi All,
I have a program trying to use mousehover to pause the autoscroll. It is a widows form called:
lstOutput System.Windows.Forms.1 Below is how it is in my code.
[/code]
Public Sub lstOutput_MouseHover(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstOutput.MouseHover
'Public EventMouseHover As EventHandler
lblPauseScroll.Text = "Output Paused" 'display output paused
'Highlight the DataGridView
Me.lstOutput.BackColor = Color.LightGray
'Change point to hand
Me.Cursor = Cursors.Hand
End Sub
Public Sub lstOutput_MouseExit(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstOutput.MouseLeave
lblPauseScroll.Text = "" 'clearing the output paused label
'Highlight the DataGridView
Me.lstOutput.BackColor = Color.White
End Sub
If (intPauseLoop >= 15) Then 'execute following code if greter than or equal 15
intPauseLoop = 1 'reset pause loop variable
'setup auto scroll check box for auto display choice
If ckboxAutoScroll.Checked = True Then
If lblPauseScroll.Text = "" Then
'setup timer for auto display
Dim timeOut As DateTime = Now.AddMilliseconds(dblAutoScroll)
' This loop is used to prevent application from freezing by
' continuing to process the application messages and continues
' until timeOut value is reached.
Do
Application.DoEvents()
Loop Until Now > timeOut
'message box for amortization display
'user input required to proceed
Else
MessageBox.Show("Press OK To Continue..", "Mortgage Amortization Table", MessageBoxButtons.OK, MessageBoxIcon.Question)
Me.lstOutput.Items.Clear()
End If
End If
[/code]
For some reason I have to click on the form to get it to pause the first time and then after that it does pause when I place the mouse over the form. It is that first time that it won't pause. The Public Subs I hand typed the codes in, is there some way that I should have added the mousehover to the form itself or are there other reasons that it won't work the first time?
Any help would be appreceated.
Thanks,
Ken
I have a program trying to use mousehover to pause the autoscroll. It is a widows form called:
lstOutput System.Windows.Forms.1 Below is how it is in my code.
[/code]
Public Sub lstOutput_MouseHover(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstOutput.MouseHover
'Public EventMouseHover As EventHandler
lblPauseScroll.Text = "Output Paused" 'display output paused
'Highlight the DataGridView
Me.lstOutput.BackColor = Color.LightGray
'Change point to hand
Me.Cursor = Cursors.Hand
End Sub
Public Sub lstOutput_MouseExit(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstOutput.MouseLeave
lblPauseScroll.Text = "" 'clearing the output paused label
'Highlight the DataGridView
Me.lstOutput.BackColor = Color.White
End Sub
If (intPauseLoop >= 15) Then 'execute following code if greter than or equal 15
intPauseLoop = 1 'reset pause loop variable
'setup auto scroll check box for auto display choice
If ckboxAutoScroll.Checked = True Then
If lblPauseScroll.Text = "" Then
'setup timer for auto display
Dim timeOut As DateTime = Now.AddMilliseconds(dblAutoScroll)
' This loop is used to prevent application from freezing by
' continuing to process the application messages and continues
' until timeOut value is reached.
Do
Application.DoEvents()
Loop Until Now > timeOut
'message box for amortization display
'user input required to proceed
Else
MessageBox.Show("Press OK To Continue..", "Mortgage Amortization Table", MessageBoxButtons.OK, MessageBoxIcon.Question)
Me.lstOutput.Items.Clear()
End If
End If
[/code]
For some reason I have to click on the form to get it to pause the first time and then after that it does pause when I place the mouse over the form. It is that first time that it won't pause. The Public Subs I hand typed the codes in, is there some way that I should have added the mousehover to the form itself or are there other reasons that it won't work the first time?
Any help would be appreceated.
Thanks,
Ken
•
•
Join Date: Sep 2008
Posts: 25
Reputation:
Solved Threads: 0
Sorry, i forgot to add the last part of my code.
[/code]
If (intCounter1 <> intLoanTerm + 1) Then 'if loan term does not equal counter
'check auto scroll command
If ckboxAutoScroll.Checked = True Then
'clear output only when auto scroll is enabled
Me.lstOutput.Items.Clear() 'clear output list box
End If
End If
End If
[/code]
[/code]
If (intCounter1 <> intLoanTerm + 1) Then 'if loan term does not equal counter
'check auto scroll command
If ckboxAutoScroll.Checked = True Then
'clear output only when auto scroll is enabled
Me.lstOutput.Items.Clear() 'clear output list box
End If
End If
End If
[/code]
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: Creating Classes in VB.NET
- Next Thread: Embedding Batch Files?
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2008 access add arithmetic array assignment basic binary bing box button buttons c# center code combobox component connectionstring convert cpu data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net editvb.net excel file-dialog firewall folder google hardcopy image images isnumericfuntioncall listview login math memory mobile ms mssqlbackend mysql navigate net networking opacity output pan peertopeervideostreaming picturebox picturebox1 plugin port print printpreview problemwithinstallation project record reports" reuse save savedialog serial server sorting sql storedprocedure string temp text textbox timer toolbox updown upload useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vbnet view vista visual visualbasic visualbasic.net visualstudio web wpf





