very good control I like it a lot and it seems simple.
but there is a problem in the attachment there is an .exe delete it and upload it again, if you can not delete the post, executables or binaries are not allowed.
I just came across this in PSC, and downloaded it.
Noticed it uses subclassing and traced that portion to wqweto's codebank entry.
When first loading it (the PSC download), I did my usual 'KISS' check to see if it had any dependencies (which I like to minimize/avoid).
Noticed it had a reference to DAO, which i unticked (I assumed it was a left over that is not needed),
As I unticked it (DAO), the Form (or at least all of the Tab .ctl's) all glazed over with that zebra striped look saying 'I am now untouchable'
Is that a portend of what may happen in the future (in one of my larger important projects) ?
Sorry to look a gift horse(zebra) in the stripes,
Rob
When first loading it (the PSC download), I did my usual 'KISS' check to see if it had any dependencies (which I like to minimize/avoid).
Noticed it had a reference to DAO, which i unticked (I assumed it was a left over that is not needed),
As I unticked it (DAO), the Form (or at least all of the Tab .ctl's) all glazed over with that zebra striped look saying 'I am now untouchable'
Is that a portend of what may happen in the future (in one of my larger important projects) ?
Sorry to look a gift horse(zebra) in the stripes,
Rob
About zebra stripes:
Don't worry, please close the form design view and open it again. We don't need any references. When we add/remove any reference or activex control , usercontrols in forms become like this.
Very good, but there is a bug that I can't fix, there is a red border when it is resized and that persists even when I minimize the vb6, only leaving when I close the vb6
Public Function SubclassProc(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long, Handled As Boolean) As Long
'Dim x As Single
'Dim y As Single
'
' Select Case wMsg
' Case WM_LBUTTONDOWN
' x = (lParam And &HFFFF&)
' y = (lParam \ &H10000 And &HFFFF&)
'
' End Select
' '--- note: performance optimization for design-time subclassing
' If Not Handled And ThunkPrivateData(m_pSubclass) = EBMODE_DESIGN Then
' Handled = True
' SubclassProc = DefSubclassProc(hwnd, wMsg, wParam, lParam)
' End If
If mUserMode = True Then
Handled = True
SubclassProc = DefSubclassProc(hwnd, wMsg, wParam, lParam)
Exit Function
End If
Dim lTab As Long
Dim x As Single
Dim y As Single
Select Case wMsg
Case WM_LBUTTONDOWN ' UserControl message, only in design mode (Not Ambient.UserMode), to provide change of selected tab by clicking at design time
' If TypeOf UserControl.Parent Is Form Then
' UserControl.Parent.Caption = Timer
' End If
' If Not MouseIsOverAContainedControl Then
lTab = selIndex
' Call ProcessMouseMove(vbLeftButton, 0, (lParam And &HFFFF&) * Screen_TwipsPerPixelX, (lParam \ &H10000 And &HFFFF&) * Screen_TwipsPerPixelX)
' X = (lParam And &HFFFF&) * Screen_TwipsPerPixelX
' Y = (lParam \ &H10000 And &HFFFF&) * Screen_TwipsPerPixely
x = (lParam And &HFFFF&)
y = (lParam \ &H10000 And &HFFFF&)
' UserControl.Parent.Caption = "X " & X & " Y " & Y
Call UserControl_MouseDown(vbLeftButton, -1, x, y)
If selIndex <> lTab Then
Handled = True
SubclassProc = 0
Exit Function
End If
' End If
' If mChangeControlsBackColor And (mTabBackColor <> vbButtonFace) Then
' mLastContainedControlsCount = UserControl.ContainedControls.Count
' tmrCheckContainedControlsAdditionDesignTime.Enabled = True
' End If
End Select
Handled = True '<<<< changed here
SubclassProc = DefSubclassProc(hwnd, wMsg, wParam, lParam)
End Function
But there is another bug, after that change, it works fine, but
if i resize the tab control down during design time, the tab's buttons stop refreshing.
Closing the designer window and opening it makes go back to refreshing.
It works correctly on run time, even if resized down.
But there is another bug, after that change, it works fine, but
if i resize the tab control down during design time, the tab's buttons stop refreshing.
Closing the designer window and opening it makes go back to refreshing.
It works correctly on run time, even if resized down.
Code:
Private Sub UserControl_Resize()
On Error Resume Next
CreateGraphicsDC
'Uncomment below line
Draw
Me.Refresh
End Sub
If the above solution doesn't work, please check your VB6 compatibility
Hi and thanks for this great achievement! I have one problem though. When I run my VB project and then click on a tab, the view changes correctly and displays controls in the 2nd container, but the tab doesn't change and remains blue and the previous tab stays orange. In the IDE designer it behaves as it should, it's only when I run the project it doesn't work.
I created a test project with a tabcontrol and added exact same controls to the container and then it runs fine, so appears to be some conflict with my project code. Any idea what could possibly cause this or exactly where in your code this could go wrong?
M$ vs. VB6 = The biggest betrayal and strategic mistake of the century!?
Some follow up on my previous post. Just to test I added a TabControl to another simpler form in my project and here the control seems to work, except for that the bottom line of the border rectangle is cut off. I also added a second control to the problematic form and just dropped some label controls on these tabs to demonstrate the issue in the attached image. The tab on the red background is on the second, working form, here opened in front of the non-working..
Both controls here show the container for Tab 2, and apart from that Tab 1 still seems to be selected on the left control, there is one more detail I have noticed. As you can see on the right side control, the Tab 2 caption has a focus rectangle after it has been clicked, this never appears on the control on the problematic form. So my conclusion is that it has to be some kind of focus issue.
One more thing, as you can see on the left control the border rectangle's bottom line is stuck with rest of the control flowing outside. THis seems to happen when site control on the form and size it beyond a certain size, not only when you resize it after sitting. As you pointed out elsewhere, closing the form and reopen it solves the issue both in the designer and at run time. However, and this may be related to the above, after closing and reopen the form of left control the problem was solved in the designer, but at run time the border issue is still there. Same happens with the original control I sited on same form, but it's much larger so have excluded it from the image. However, this border issue seems to be "proportional" in relation to the size of the sited control.
OK I will leave it there and continue to investigate if I can figure out what happens, but if you have any idea of what may go on or where to look/test/debug it would be appreciated.
M$ vs. VB6 = The biggest betrayal and strategic mistake of the century!?
Some follow up on my previous post. Just to test I added a TabControl to another simpler form in my project and here the control seems to work, except for that the bottom line of the border rectangle is cut off. I also added a second control to the problematic form and just dropped some label controls on these tabs to demonstrate the issue in the attached image. The tab on the red background is on the second, working form, here opened in front of the non-working..
Both controls here show the container for Tab 2, and apart from that Tab 1 still seems to be selected on the left control, there is one more detail I have noticed. As you can see on the right side control, the Tab 2 caption has a focus rectangle after it has been clicked, this never appears on the control on the problematic form. So my conclusion is that it has to be some kind of focus issue.
One more thing, as you can see on the left control the border rectangle's bottom line is stuck with rest of the control flowing outside. THis seems to happen when site control on the form and size it beyond a certain size, not only when you resize it after sitting. As you pointed out elsewhere, closing the form and reopen it solves the issue both in the designer and at run time. However, and this may be related to the above, after closing and reopen the form of left control the problem was solved in the designer, but at run time the border issue is still there. Same happens with the original control I sited on same form, but it's much larger so have excluded it from the image. However, this border issue seems to be "proportional" in relation to the size of the sited control.
OK I will leave it there and continue to investigate if I can figure out what happens, but if you have any idea of what may go on or where to look/test/debug it would be appreciated.
Hi, Thank you for your interest in this project. Can you please attach the problematic forms here with source code so that I may check and reproduce the conditions that caused the bug.
I felt like I don't have time to deal with this right now, so decided to try out Eduardo's SSTabEx control instead, which seems to work so will stick with that for the time being. I still like your control and may try it in another project, and also when I have more time to dive into the control code as well. Keep up the good work.
M$ vs. VB6 = The biggest betrayal and strategic mistake of the century!?