|
-
Dec 2nd, 2016, 11:46 AM
#1
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Karl77
The border is not wanted, it makes problems when the control is nested in another control (statusbar in this case).
I'll try to change it myself, now as I know where to look.
Otherwise we would need a Border property...
It's difficult to have no border as it's back always when the control size has been changed.
-
Dec 2nd, 2016, 12:42 PM
#2
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
It's difficult to have no border as it's back always when the control size has been changed.
Yes, I experienced this too.
Solution seems to be simple:
Code:
Public Property Let VisualStyles(ByVal Value As Boolean)
PropVisualStyles = Value
If ProgressBarHandle <> 0 And EnabledVisualStyles() = True Then
Dim dwExStyle As Long, dwExStyleOld As Long
dwExStyle = GetWindowLong(hWnd, GWL_EXSTYLE)
dwExStyleOld = dwExStyle
If PropVisualStyles = True Then
ActivateVisualStyles ProgressBarHandle
If (dwExStyle And WS_EX_STATICEDGE) = WS_EX_STATICEDGE Then dwExStyle = dwExStyle And Not WS_EX_STATICEDGE
Else
RemoveVisualStyles ProgressBarHandle
If Not (dwExStyle And WS_EX_STATICEDGE) = WS_EX_STATICEDGE Then
dwExStyle = dwExStyle And Not WS_EX_STATICEDGE
End If
End If
'If dwExStyle <> dwExStyleOld Then
SetWindowLong ProgressBarHandle, GWL_EXSTYLE, dwExStyle
Call ComCtlsFrameChanged(ProgressBarHandle)
'End If
Me.Refresh
End If
UserControl.PropertyChanged "VisualStyles"
End Property
EDIT:
This is also the place where a Border property could snap to.
Last edited by Karl77; Dec 2nd, 2016 at 12:46 PM.
-
Dec 2nd, 2016, 12:51 PM
#3
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Karl77
Yes, I experienced this too.
Solution seems to be simple:
Code:
Public Property Let VisualStyles(ByVal Value As Boolean)
PropVisualStyles = Value
If ProgressBarHandle <> 0 And EnabledVisualStyles() = True Then
Dim dwExStyle As Long, dwExStyleOld As Long
dwExStyle = GetWindowLong(hWnd, GWL_EXSTYLE)
dwExStyleOld = dwExStyle
If PropVisualStyles = True Then
ActivateVisualStyles ProgressBarHandle
If (dwExStyle And WS_EX_STATICEDGE) = WS_EX_STATICEDGE Then dwExStyle = dwExStyle And Not WS_EX_STATICEDGE
Else
RemoveVisualStyles ProgressBarHandle
If Not (dwExStyle And WS_EX_STATICEDGE) = WS_EX_STATICEDGE Then
dwExStyle = dwExStyle And Not WS_EX_STATICEDGE
End If
End If
'If dwExStyle <> dwExStyleOld Then
SetWindowLong ProgressBarHandle, GWL_EXSTYLE, dwExStyle
Call ComCtlsFrameChanged(ProgressBarHandle)
'End If
Me.Refresh
End If
UserControl.PropertyChanged "VisualStyles"
End Property
EDIT:
This is also the place where a Border property could snap to.
What does that solve when resizing?
You changed the part on RemoveVisualStyles, but there is an error on your change.
Code:
RemoveVisualStyles ProgressBarHandle
If Not (dwExStyle And WS_EX_STATICEDGE) = WS_EX_STATICEDGE Then
dwExStyle = dwExStyle And Not WS_EX_STATICEDGE
End If
Should be:
Code:
RemoveVisualStyles ProgressBarHandle
If (dwExStyle And WS_EX_STATICEDGE) = WS_EX_STATICEDGE Then
dwExStyle = dwExStyle And Not WS_EX_STATICEDGE
End If
As you want no border in both cases.
Last edited by Krool; Dec 2nd, 2016 at 01:00 PM.
-
Dec 3rd, 2016, 09:45 AM
#4
Fanatic Member
Re: CommonControls (Replacement of the MS common controls)
 Originally Posted by Krool
What does that solve when resizing?
Apparently it works, no border comes back on resize.
Try it...
As you want no border in both cases.
Not exactly, I don't want the border in classic style only.
Karl
Last edited by Karl77; Dec 3rd, 2016 at 10:51 AM.
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
|