我如何转换以下内容?我正在将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
Run Code Online (Sandbox Code Playgroud)
谢谢
我正在尝试移植:http: //www.vbaccelerator.com/home/vb/code/libraries/xp_visual_styles/drawing_with_xp_visual_styles/VB6_Theme_Explorer.asp
这个代码在VB6中:
Public Property Get Width() As Long
Width = m_lWidth
End Property
Public Property Let Width(ByVal value As Long)
m_lWidth = value
End Property
Run Code Online (Sandbox Code Playgroud)
...在VB.NET中等效于此:
Public Property Width() As Integer
Get
Return m_lWidth
End Get
Set(ByVal Value As Integer)
m_lWidth = Value
End Set
End Property
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3269 次 |
最近记录: |