Cyber_Boy
07-19-2003, 03:05 AM
In my program, im using several UpDown Controls (Included in the common controls). Now, when i put them on my form, and apply the Windows XP Styles to the controls, all the forms get the style, but these controls do not!
How can i make an UpDown like these in the pictures? Do i need to change the control or something?
thanks a lots!
Look at the attachment, there is the picture of my application, which has UpDown controls not using the XP sytles, and of other applications using the UpDown controls with the XP styles.
thanks!
vbfan
07-19-2003, 03:32 AM
Do you use a Manifest File, and call InitCommonControls at the start of your app?
Rename the Attachment only to your AppName.exe.manifest and set it in the same directory as your Exe, and call on Form Load the API InitCommonControls.
Cyber_Boy
07-19-2003, 04:01 AM
yep i am. If you noted what i said, most of the controls are being applied to the XP style, but those UpDown controld do not! Its not that im not setting the form to XP Style, but the UpDown controls are not being set to XP Style.
Public Sub Main()
'As you can see, im initializing using this:
Randomize
InitCommonControlsVB
InitializePaths
SetInfo
FrmMain.Show
End Sub
Public Function InitCommonControlsVB() As Boolean
On Error Resume Next
Dim iccex As tagInitCommonControlsEx
' Ensure CC available:
With iccex
.lngSize = LenB(iccex)
.lngICC = ICC_USEREX_CLASSES
End With
InitCommonControlsEx iccex
InitCommonControlsVB = (Err.Number = 0)
On Error GoTo 0
End Function
Thanks and any suggestions plz?
:)
vbfan
07-19-2003, 04:25 AM
Public Sub Main()
'As you can see, im initializing using this:
Randomize
InitCommonControlsVB
InitializePaths
SetInfo
FrmMain.Show
End Sub
Public Function InitCommonControlsVB() As Boolean
On Error Resume Next
Dim iccex As tagInitCommonControlsEx
' Ensure CC available:
With iccex
.lngSize = LenB(iccex)
.lngICC = ICC_USEREX_CLASSES
End With
InitCommonControlsEx iccex
InitCommonControlsVB = (Err.Number = 0)
On Error GoTo 0
End Function
Why do you use so much Code normally it's enough to Use(maybe it's because you use InitCommonControlsEX and not InitCommoncontrols):
Public Sub Main()
InitCommonControls
End Sub
Cyber_Boy
07-19-2003, 04:32 AM
no it does no Difference. That i think, only checks for the windows XP installed or somethings. Its from EliteVB that code snippet
Squishy
07-19-2003, 07:59 PM
Try using Microsoft Windows Common Controls-2 5.0 instead of 6.0 (see attached image)
And btw...all the code I had to use was
Option Explicit
Private Declare Function InitCommonControls Lib "comctl32.dll" () As Long
Private Sub Form_Initialize()
InitCommonControls
End Sub
Cyber_Boy
07-20-2003, 04:09 AM
i tink that code is enough. Dont tknow why i am usign that long piece, maybe because i thought the more lengthy, the better hehe :)
ill change to that simple 2 lines. Also ill try Those Controls you mentioned. Hope they worked
thanks and good morning :)
c ya
Cyber_Boy
07-20-2003, 04:10 AM
yep it worked, and those controls are better because i dont have to distribute all the v6 (they're larger) controls!
thanks a lot for the help!