SelectTab Method does not raise TabClick event if first tab was selected

Summary

Id: 2766.1
Type: Bug Bug
Current Status: Open

Detail

1 Feb 2003 Open Markus Weber

No TabClick event will be raised if the first Tab of the TabControl is selected and I call the SelectTab-method.

Example:

- Tab 1 (the first tab) is selected and

- I call the SelectTab method

I think the following part of the SelectTab-method has an bug:

lR = SendMessageLong(m_hWnd, TCM_SETCURSEL, lIndex, 0) If (lR = 0) Then <= IMO 0 means that the first tab has selected ' Failed.. Else If Not (bNoEvents) Then RaiseEvent TabClick(lIndex + 1) End If End If

According to the MSDN the value -1 is returned if SendMessage fails. I think 0 is returned if the first tab has been selected.