Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

win2000 style for form and controls

Status
Not open for further replies.

Ropje

Programmer
Jun 27, 2000
13
NL
I work with win95, but I would like to build an application that looks like an win2000 application. That is, the style of the buttons and menu. Is it possible to "simulate" this?
Or do I have to use modified controls for this?
Or is this a stupid question?

The issue is that I want to build an application, very small, that looks (and will be) very robust and professional.
It is for demonstration purposes only , and I like the winn2000-gui(flat buttons) very much.
 
' * Give an Office 2000 look to your controls
' *
' **********************************************************************

'NB : BorderStyle = 0 to the controls to see

Private Declare Function GetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal Hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal Hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long Private Declare Function SetWindowPos Lib "user32" (ByVal Hwnd As Long, _
ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, _
ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long

Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_CLIENTEDGE = &H200
Private Const WS_EX_STATICEDGE = &H20000

Private Const SWP_FRAMECHANGED = &H20 ' Frame Changed
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOOWNERZORDER = &H200
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOZORDER = &H4
Public Function ThinBorder(ByVal lhWnd As Long, ByVal bState As Boolean)

Dim rtnVal As Long

rtnVal = GetWindowLong(lhWnd, GWL_EXSTYLE)

If Not (bState) Then
rtnVal = rtnVal Or WS_EX_CLIENTEDGE And Not WS_EX_STATICEDGE
Else
rtnVal = rtnVal Or WS_EX_STATICEDGE And Not WS_EX_CLIENTEDGE
End If

SetWindowLong lhWnd, GWL_EXSTYLE, rtnVal
SetWindowPos lhWnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or _
SWP_NOOWNERZORDER Or SWP_NOZORDER Or SWP_FRAMECHANGED

End Function

'-- End --'

Public Sub OfficeThinBorder(ByVal lhWnd As Long, ByVal bState As Boolean)
'Crée un bord de composants au style Office 2000
'Mettre BorderStyle à 0 du contrôle pour voir de l'effet...
'Exemple :
'OfficeThinBorder Text1.Hwnd, True '<= Applique le Style Office 2000
'OfficeThinBorder Text1.Hwnd, False '<= Enlève le Style Office 2000
ThinBorder lhWnd, bState
End Sub Eric De Decker
vbg.be@vbgroup.nl

Licence And Copy Protection AxtiveX
Source CodeBook for the programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top