Не могу изменить высоту стандартного тулбара.
В режиме проектирования высота меняется, однако при запуске все равно показывает суженное значение.
Хакер писал(а):И лично у меня в режиме проектирования высота тоже не устанавливается произвольной. Проверил на 5-ой и 6-ой версие ocx-обёртки над виндовым контроллом. А ты о чем говоришь?
Gogic писал(а):А вообще суть вопроса такая, мне нужно сделать прозрачный пикчербокс, но SetLayeredWindowAttributes применима только к window, и его потомкам, а тулбар вроде как является потомком окна формы.
В общем, я хотел создать тулбар, поместить на него пикчербокс, и задавать уже полупрозрачность тулбара.
Хакер писал(а):Для каких целей тебе полупрозрачный PictureBox?
Public Enum GpStatus
Ok = 0
GenericError = 1
InvalidParameter = 2
OutOfMemory = 3
ObjectBusy = 4
InsufficientBuffer = 5
NotImplemented = 6
Win32Error = 7
WrongState = 8
Aborted = 9
FileNotFound = 10
ValueOverflow = 11
AccessDenied = 12
UnknownImageFormat = 13
FontFamilyNotFound = 14
FontStyleNotFound = 15
NotTrueTypeFont = 16
UnsupportedGdiplusVersion = 17
GdiplusNotInitialized = 18
PropertyNotFound = 19
PropertyNotSupported = 20
End Enum
Public Type GdiplusStartupInput
GdiplusVersion As Long
DebugEventCallback As Long
SuppressBackgroundThread As Long
SuppressExternalCodecs As Long
End Type
Public Declare Function GdiplusStartup Lib "gdiplus" (token As Long, inputbuf As GdiplusStartupInput, Optional ByVal outputbuf As Long = 0) As GpStatus
Public Declare Function GdiplusShutdown Lib "gdiplus" (ByVal token As Long) As GpStatus
Public Declare Function GdipCreateFromHDC Lib "gdiplus" (ByVal HDC As Long, graphics As Long) As GpStatus
Public Declare Function GdipLoadImageFromFile Lib "gdiplus" (ByVal FileName As String, image As Long) As GpStatus
Public Declare Function GdipGetImageWidth Lib "gdiplus" (ByVal image As Long, Width As Long) As GpStatus
Public Declare Function GdipGetImageHeight Lib "gdiplus" (ByVal image As Long, Height As Long) As GpStatus
Public Declare Function GdipDrawImageRect Lib "gdiplus" (ByVal graphics As Long, ByVal image As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single) As GpStatus
Public Declare Function GdipDisposeImage Lib "gdiplus" (ByVal image As Long) As GpStatus
Public Declare Function GdipDeleteGraphics Lib "gdiplus" (ByVal graphics As Long) As GpStatus
Public token As Long
Public Function LoadAndDrawImage(ByVal FileName As String, ByVal hDestDC As Long, ByVal DestWidth As Long, ByVal DestHeight As Long) As GpStatus
Dim lngWidth As Long, lngHeight As Long
Dim graphics As Long, img As Long
Dim GpInput As GdiplusStartupInput
Dim tmp_status As GpStatus
GpInput.GdiplusVersion = 1
tmp_status = GdiplusStartup(token, GpInput)
If tmp_status <> Ok Then GoTo The_End:
tmp_status = GdipCreateFromHDC(hDestDC, graphics)
If tmp_status <> Ok Then GoTo The_End:
tmp_status = GdipLoadImageFromFile(StrConv(FileName, vbUnicode), img)
If tmp_status <> Ok Then GoTo The_End:
tmp_status = GdipGetImageHeight(img, lngHeight)
If tmp_status <> Ok Then GoTo The_End:
tmp_status = GdipGetImageWidth(img, lngWidth)
If tmp_status <> Ok Then GoTo The_End:
tmp_status = GdipDrawImageRect(graphics, img, 0, 0, DestWidth, DestHeight) 'lngWidth, lngHeight)
If tmp_status <> Ok Then GoTo The_End:
tmp_status = GdipDisposeImage(img)
If tmp_status <> Ok Then GoTo The_End:
tmp_status = GdipDeleteGraphics(graphics)
If tmp_status <> Ok Then GoTo The_End:
tmp_status = GdiplusShutdown(token)
The_End:
LoadAndDrawImage = tmp_status
End Function
Private Sub Command3_Click()
Me.AutoRedraw = True
LoadAndDrawImage App.Path & "\1.png", Me.HDC, Me.ScaleWidth, Me.ScaleHeight
Me.Refresh
End Sub
Сейчас этот форум просматривают: Google-бот и гости: 8