cdm100497
asked on
Changing Style of Common Control Toolbar
I would like to change the style of the Common Control Toolbar to support the new Flatbar style... I have implemented the following code in the Form Activate event but it does not appear to work...
Dim lStyle As Long
Const TBSTYLE_FLAT = &H800
lStyle = GetWindowLong(tbrStandard. hWnd, 0)
lStyle = lStyle Or TBSTYLE_FLAT
SetWindowLong tbrStandard.hWnd, 0, lStyle
This code was taken from the CWnd::ModifyStyle code in the MFC class libraries...
1) Does the Common Control Support this style
2) Is this code valid or do I need to do something else
Dim lStyle As Long
Const TBSTYLE_FLAT = &H800
lStyle = GetWindowLong(tbrStandard.
lStyle = lStyle Or TBSTYLE_FLAT
SetWindowLong tbrStandard.hWnd, 0, lStyle
This code was taken from the CWnd::ModifyStyle code in the MFC class libraries...
1) Does the Common Control Support this style
2) Is this code valid or do I need to do something else
Have you def'd the getwindowlong and setwindowlong in your vb project?
ASKER
I have... All the code works (in that it runs/compiles without producing errors) however it does not appear to do anything.
i've a small revision to this code, in GetWindowLong and SetWindowLong where it is a 0 it should be -16. -16 is the index for the style. However this doesn't do a thing in VB. Does it really works in Visual C???
ASKER
In Visual C I used the ModifyStyle command... This produced a Flat toolbar, however this was using the CToolbar functionality, which should be using the Common Control DLL but may not do I suppose... I will look into it further and find out.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I added this code to the project... Whilst it works, there would appear to be some problems.
1) The control does not work correctly. i.e. the buttons to not highlight when you move over them.
2) On the MDI Form the code does not work. Any more suggestions.
1) The control does not work correctly. i.e. the buttons to not highlight when you move over them.
2) On the MDI Form the code does not work. Any more suggestions.