Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi:

 

I am using a standard combo box. When the user tabs in, I use the drop down property to let them select from the list...which works fine. But, the mouse cursor disappears until a selection is made from the drop down list.

 

I have tried variations of cursor.show and the cursor is set to the arrow in the properties window...but it won't show.

 

Thoughts?

 

Eric

Posted

Found the answer...in case someone can use it

 

'This method sets the cursor above a combo box when the method of entry is something other than

'a mouse click. If not used, the mouse cursor will not show.

'

'PLEASE NOTE: The "fudge" factors in the positioning of the cursor were obtained through

'trial and error...

Private Sub SetUpComboCursor(ByRef pCombobox As ComboBox _

, ByVal pParentComponentId As Integer)

Dim ComboBoxScreenPt As Point

Dim ComboBoxTop As Integer

Dim ComboBoxRight As Integer

 

Try

'get the current cursor position, move over combo box and then set drop down.

If pParentComponentId = Constants.VITALS_TAB Then

ComboBoxScreenPt = New Point(pCombobox.Location.X - 60, pCombobox.Location.Y - 15)

ComboBoxScreenPt = pCombobox.PointToScreen(ComboBoxScreenPt)

Cursor.Position = ComboBoxScreenPt

pCombobox.Cursor = Cursors.Default

pCombobox.DroppedDown = True

 

Else

'assume main form

ComboBoxTop = Me.Location.Y + pCombobox.Location.Y + 50

ComboBoxRight = Me.Location.X + pCombobox.Location.X + (pCombobox.Width - 5)

Cursor.Position = New Point(ComboBoxRight, ComboBoxTop)

pCombobox.Cursor = Cursors.Default

pCombobox.DroppedDown = True

End If

 

Catch ex As Exception

LocalErrorLink.Error_Handler(ex)

End Try

 

End Sub

 

Found a version of this on another website.

 

Eric

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...