|
-
Oct 8th, 2012, 08:37 AM
#9
Thread Starter
PowerPoster
Re: [VB6] - error message without ID only message
 Originally Posted by 4x2y
Like i did
Code:
Private Sub UserControl_Resize()
Static blnResizing As Boolean ' ----------------- New Code
On Error Resume Next
If blnResizing Then Exit Sub ' ----------------- New Code
If UserControl.hWnd = 0 Then Exit Sub
If blnShowed = True Then Call ShowImage
If (UserControl.Width <> lngOldWidth And UserControl.Height <> lngOldHeight) Then
ResizeTyp = ResizeVerticalHorizontal
ElseIf UserControl.Width <> lngOldWidth Then
ResizeTyp = ResizeHorizontal
ElseIf UserControl.Height <> lngOldHeight Then
ResizeTyp = ResizeVertical
End If
lngOldWidth = UserControl.Width
lngOldHeight = UserControl.Height
blnResizing = True ' ----------------- New Code
RaiseEvent Resize(UserControl.Width, UserControl.Height, ResizeTyp)
blnResizing = False ' ----------------- New Code
End Sub
I don't know if this will be compatible with your code or not, just give it a try.
and i did and works:
Code:
Private Sub UserControl_Resize()
Static blnResizing As Boolean
If blnResizing Then Exit Sub ' comment this line and see the difference :-)
blnResizing = True
On Error Resume Next
If UserControl.hWnd = 0 Then Exit Sub
If blnShowed = True Then Call ShowImage
If (UserControl.Width <> lngOldWidth And UserControl.Height <> lngOldHeight) Then
ResizeTyp = ResizeVerticalHorizontal
ElseIf UserControl.Width <> lngOldWidth Then
ResizeTyp = ResizeHorizontal
ElseIf UserControl.Height <> lngOldHeight Then
ResizeTyp = ResizeVertical
End If
lngOldWidth = UserControl.Width
lngOldHeight = UserControl.Height
RaiseEvent Resize(UserControl.Width, UserControl.Height, ResizeTyp)
blnResizing = False
End Sub
i have a new question that i think you can advice me
i want do the same to showimage() sub. but like you know, we, always, change the graphics effects properties. then how i can do that boolean way? in same way?
thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|