Click and DoubleClick

moongodess

Freshman
Joined
Dec 23, 2004
Messages
40
Hi! I hope you can help me somehow, because I have a big, big problem...

I have a grid with some rows.

When I click a row my program must verify if there are some specific (important) details for the selected guest (row).
If there are, it must show the 'details window'.
When I double click a row it must do the same, but after closing the details window, must open the 'master window' of that guest.

When I make just one click, everything works fine, but when I make double click not so good :(
If there are no details the master window appears.
If there are details the 'details window' appears, but when I close it the other window doesn't appear.

Do you have any idea for what I need? Please..
 
The code is the following:
Code:
[SIZE=1][FONT=Verdana]Private Sub gdxSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles gdxSearch.Click
      If (gdxSearch.HitTest = GridEX.GridArea.Cell) Then
         msSelectRow()
      End If
   End Sub
   Private Sub gdxSearch_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles gdxSearch.DoubleClick
      If (gdxSearch.HitTest = GridEX.GridArea.Cell) Then
         msSelectRow(True)
      End If
   End Sub

   Private Sub msSelectRow(Optional ByRef bolOpen As Boolean = False)
      On Error GoTo ShowError

      Dim gdrRow As GridEX.GridEXRow = gdxSearch.GetRow()
      Dim intId As Integer = CInt(gdrRow.Cells("GuestId").Value)
      Dim intType As Integer = CInt(gdrRow.Cells("GuestType").Value)

      Dim bolRefresh As Boolean = False

      ShowPopup(intId)

      If (bolOpen = True) Then
         Id = intId
         If (Id > 0) Then
            Select Case Mode
               Case Open.Sch
                  Dim f As frmUpdate
                  f = New frmUpdate

                  f.Id = Id
                  f.Type = intType
                  f.ShowDialog()
                  bolRefresh = f.Saved

                  f = Nothing
               Case Open.Sel
                  Me.Close()
            End Select
         End If
      End If

      If (bolRefresh = True) Then
         intStartAt = 0
         msRefreshGrid(Direc.Front)
      End If

      Exit Sub
ShowError:
      InfoError(Err.Number, Err.Description)
      Exit Sub
   End Sub

   Public Sub ShowPopup(ByVal intId As Integer)
      On Error GoTo ShowError

      Dim bolShow As Boolean = DbParameterGet(PIPopupShow, PVPopupShow, PTBol, PDPopupShow)
      Dim bolExists As Boolean = DbPopupExists(intId)
      Dim strShow As String = GetSetting(SetApp, SetSec(intId), SetKeyDate, DateString)
      Dim dtmShow As Date = CDate(strShow)
      Dim bolDate As Boolean = (dtmShow < DbHotelDate())

      If ((bolShow = True) And (bolExists = True) And (bolDate = True)) Then
         Dim f As frmPopup
         f = New frmPopup

         f.Id = intId
         f.ShowDialog()

         f = Nothing
      End If

      Exit Sub
ShowError:
      InfoError(Err.Number, Err.Description)
      Exit Sub
   End Sub[/FONT][/SIZE]
 
Have you tried putting breakpoints in the Click and DoubleClick event handlers and seeing what exactly is being called when you double click?
 
Is the double click behaving the same as the click. I ask this because I once had the same problem and ended up using the SelectedIndexChanged sub instead of the Click sub to solve the problem.
 
Machaira said:
Have you tried putting breakpoints in the Click and DoubleClick event handlers and seeing what exactly is being called when you double click?
Yes.. Let me try to explain what happens...

If I have no breakpoints:
- If I doubleclick and there are no details to show it shows the main windows as supposed to (and also a message just to indicate that it was a double click)
- But, if I double click and there are details to show it shows the detail window, but doesn't show the message box and the main window :(

If I have break points:
- It always work as if it was a single click

It seems to me that showing the detail window is 'disabling' the double click for some reason :(
 
DiverDan said:
Is the double click behaving the same as the click. I ask this because I once had the same problem and ended up using the SelectedIndexChanged sub instead of the Click sub to solve the problem.
My only problem using SelectedIndexChanged (or stg like that) is that I don't wanna show the detail window if the user is navigating in the grid with the keybord.
But... If I can find a way to know if it was a click or a keypress........ It would be great!! Does the 'sender' object gave me that?
Sorry, but I'm not to familiarized with the newm objects of vb.net :)
 
Back
Top