E
eBob.com
I have two apps, both developed using the same VBE, and both having a
VScrollBar, but the two VScrollBars have very different styles. (In the
screen shot, which I had hoped to attach but can't, one appears on the left
and the other appears on the right. But, even without the screen shot,
referring to the two cases as the "left case" and the "right case" seems to
make as much sense as any other way of distinguishing the two cases. So
I'll stick with that.) In the one case, on the left, the VScrollBar uses a
baby blue and
white color scheme and rounded corners. To me it has a more modern
appearance than the one on the right, which uses a beige and light beige
color scheme and square corners.
In both cases the VScrollBars are on a usercontrol which inherits from
UserControl. (I don't know why I do that other than an assumption that
UserControl must exist so that user controls can inherit from it.) In both
cases the VScrollBars are instantiated by a "Dim vsb As New VScrollBar" in
the Class. In both cases the constructor of the usercontrol uses the
following code to place and display the VScrollBar ...
vsb.Location = New Point(Me.Width - vsb.Width, 0)
vsb.Height = Me.Height
vsb.Enabled = True
vsb.Show()
Controls.Add(vsb)
In the case on the right, although it is not obvious, the text "label text"
results from a Label which is also part of the usercontrol. But removing it
makes no difference. In the case on the left the usercontrol contains only
the VScrollBar and the form contains only the usercontrol. In the case on
the right the usercontrol contains only the VScrollBar and a Label but the
usercontrol is on a somewhat "busy" form - i.e. it contains a number of
controls.
I've found a lot of previous discussion about differing styles for
VScrollBars in different circumstances. But my VScrollBars occur in the
same circumstances! One of the earlier posts, although it didn't explain my
problem, contained a URL I'd like to look at but the link no longer works.
(It's appended below.)
I'll be grateful for any insight anyone can provide.
Thanks, Bob
=====================================
To apply XP theme to your application, you may just simply bind your
controls to Comctl32.dll version 6.0 (it's so great that no additional code
needed). Here is an article on this topic from MSDN, which described it in
detailed. You may get it from the link below:
Using Windows XP Visual Styles With Controls on Windows Forms
http://msdn.microsoft.com/library/en-us/dv_vstechart/html/vbtchUsingW...
PVisualStylesWithControlsOnWindowsForms.asp
Please Note: it is not all controls support XP visual style. However
ScrollBars supports
I hope this information helps you.
Best regards,
Lion Shi [MSFT]
MCSE, MCSD
Microsoft Support Engineer
VScrollBar, but the two VScrollBars have very different styles. (In the
screen shot, which I had hoped to attach but can't, one appears on the left
and the other appears on the right. But, even without the screen shot,
referring to the two cases as the "left case" and the "right case" seems to
make as much sense as any other way of distinguishing the two cases. So
I'll stick with that.) In the one case, on the left, the VScrollBar uses a
baby blue and
white color scheme and rounded corners. To me it has a more modern
appearance than the one on the right, which uses a beige and light beige
color scheme and square corners.
In both cases the VScrollBars are on a usercontrol which inherits from
UserControl. (I don't know why I do that other than an assumption that
UserControl must exist so that user controls can inherit from it.) In both
cases the VScrollBars are instantiated by a "Dim vsb As New VScrollBar" in
the Class. In both cases the constructor of the usercontrol uses the
following code to place and display the VScrollBar ...
vsb.Location = New Point(Me.Width - vsb.Width, 0)
vsb.Height = Me.Height
vsb.Enabled = True
vsb.Show()
Controls.Add(vsb)
In the case on the right, although it is not obvious, the text "label text"
results from a Label which is also part of the usercontrol. But removing it
makes no difference. In the case on the left the usercontrol contains only
the VScrollBar and the form contains only the usercontrol. In the case on
the right the usercontrol contains only the VScrollBar and a Label but the
usercontrol is on a somewhat "busy" form - i.e. it contains a number of
controls.
I've found a lot of previous discussion about differing styles for
VScrollBars in different circumstances. But my VScrollBars occur in the
same circumstances! One of the earlier posts, although it didn't explain my
problem, contained a URL I'd like to look at but the link no longer works.
(It's appended below.)
I'll be grateful for any insight anyone can provide.
Thanks, Bob
=====================================
To apply XP theme to your application, you may just simply bind your
controls to Comctl32.dll version 6.0 (it's so great that no additional code
needed). Here is an article on this topic from MSDN, which described it in
detailed. You may get it from the link below:
Using Windows XP Visual Styles With Controls on Windows Forms
http://msdn.microsoft.com/library/en-us/dv_vstechart/html/vbtchUsingW...
PVisualStylesWithControlsOnWindowsForms.asp
Please Note: it is not all controls support XP visual style. However
ScrollBars supports
I hope this information helps you.
Best regards,
Lion Shi [MSFT]
MCSE, MCSD
Microsoft Support Engineer