|
Данный пример добавляет почти по границе формы
небольшую кайму, определяющую внешний вид формы.
Такой вид, как если бы на форме присутствовал
элемент Frame, CommandButton или
нажатый CommandButton. Private Const BDR_SUNKENOUTER = &H2
Private Const BDR_RAISEDINNER = &H4
Private Const BF_BOTTOM = &H8
Private Const BF_LEFT = &H1
Private Const BF_RIGHT = &H4
Private Const BF_TOP = &H2
Private Const EDGE_ETCHED = (BDR_SUNKENOUTER Or BDR_RAISEDINNER)
Private Const BF_RECT = (BF_LEFT Or BF_TOP Or BF_RIGHT Or BF_BOTTOM)
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function DrawEdge Lib "user32" (ByVal hdc As Long, qrc As RECT,
ByVal edge As Long, ByVal grfFlags As Long) As Long
Private Declare Function SetRect Lib "user32" (lpRect As RECT, ByVal X1 As Long,
ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Sub Form_Paint()
Dim TRect As RECT
Me.ScaleMode = vbPixels
SetRect TRect, 10, 10, Me.ScaleWidth - 10, Me.ScaleHeight - 10
'вы можете использовать одну из трех строчек ниже
'DrawEdge Me.hdc, TRect, EDGE_ETCHED, BF_RECT
DrawEdge Me.hdc, TRect, BDR_SUNKENOUTER, BF_RECT
'DrawEdge Me.hdc, TRect, BDR_RAISEDINNER, BF_RECT
End Sub
|
|