Comment convertir les éléments suivants? Je porte une application vb 6 sur vb .net.Getters et setters de vb 6 à vb .net
Public Property Get Width() As Long
Width = m_lWidth
End Property
Public Property Let Width(ByVal value As Long)
m_lWidth = value
End Property
Public Property Get Height() As Long
Height = m_lHeight
End Property
Public Property Let Height(ByVal value As Long)
m_lHeight = value
End Property
Public Property Get PartHeight(Optional ByVal eWidthOptions As THEMESIZE = TS_TRUE) As Long
Dim tSize As SIZE
Dim tR As RECT
Dim hTheme As Long
Dim lR As Long
hTheme = OpenThemeData(m_hWnd, StrPtr(m_sClass))
If (hTheme) Then
lR = GetThemePartSize(hTheme, m_hDC, m_lPartId, m_lStateId, tR, eWidthOptions, tSize)
If (lR = S_OK) Then
PartHeight = tSize.cY
Else
pFailed "Failed to read part size for class '" & m_sClass & "', partId=" & m_lPartId & ", stateId=" & m_lStateId, lR
End If
CloseThemeData hTheme
Else
pFailed "No theme data for class '" & m_sClass & "'", Err.LastDllError
End If
End Property
Merci
Je suis en train de le port: http://www.vbaccelerator.com/home/vb/code/libraries/xp_visual_styles/drawing_with_xp_visual_styles/VB6_Theme_Explorer.asp
Vous pourriez savoir que dans des styles visuels .NET sont appliqués [un peu plus facile] (http://msdn.microsoft.com/en-us/library/system.windows.forms.application.enablevisualstyles.aspx). Et il existe des classes spéciales pour dessiner facilement des contrôles, tels que [celui-ci] (http://msdn.microsoft.com/en-us/library/system.windows.forms.buttonrenderer.aspx). – GSerg
Y at-il un moyen de dessiner des parties de thème, je veux extraire et les enregistrer tous en tant que png – jmasterx
[Cliquez juste un peu plus profond] (http://msdn.microsoft.com/en-us/library/system.windows.forms .visualstyles.visualstylerenderer.aspx). – GSerg