thanks again
you have saved me from much trouble
i this i'll try this one
Printable View
thanks again
you have saved me from much trouble
i this i'll try this one
oops you removed the code why?
ok thanks. waiting......
thanks again for you bright idea
Updated the Framez control to v1.12.
Added WinXP/Win7 to Frame Styles.
Also includes an updated demo of the TabStrip Experiment, the Windows XP frame style now looks correct.
Glad I could help, though it looks great under WinXP that gradient look isn't used under Win7.
I was just playing with Windows 7 RC and the styles are different, the TabStrip no longer has that gradient look in its body, that area is all white. The Frames also look a little different, Win7 frames are single line too but with a less rounded corner. Not sure if it is the same way in Vista or not, haven't played with Vista much at all.
windows 7 or vista? whats d difference am using xp
so for win7 what do you suggest
If we wanted the tabstrip experiment project to match the OS (as close as possible) we'd first check to see what OS is running, if its Vista or Win7 then we don't apply the gradient to the pic box container and leave it as a solid white, and set the style of the v1.1.2 Framez control to Win7.
I looked at some screen shots of Vista and Win7 and the tabstrip and frame look the same to me, though depending on the theme selected I'm sure the colors will change. If you really want your program to match the OS style at all times you really need to look at theme aware type controls, or possibly subclass so your project always knows if the theme/colors have changed and apply the needed changes to your controls.
and just how do i do that?
you know i was just wandering if all this effort is not too much for just the frame control
remeber that the initial aim was to make the frame control look transparent. i had a code that does that but was slower when i had like three or four frame controls on a tabstrip
Also remember there are different themes available: the best way to go is to use the theme drawing APIs or hack around the default Windows controls (group box in this case), but that requires advanced knowledge and tricks.
This is how you get the hWnd of the native VB frame (and actually any VB control that must have a hWnd in the first place).Code:Private Declare Sub GetMem4 Lib "msvbvm60" (ByVal Ptr As Long, Value As Long)
' ..
Dim lnghWnd As Long
GetMem4 ObjPtr(Frame1) + 68, lnghWnd
i got this themeing project from vbaccelerator but i don't know how to use it. the theming program is to help anyone doing themming
as regards theming which do you think would be better
app theming or windows theming
This relates to this topic a bit so I'm posting this here. I hacked around a bit to figure out if I could have an alpha transparent frame. I got it somewhat working but I don't have the time to play with this further.
Two issues: 1) the control does not move when the form is moved and 2) the z-index is lost, I don't know if it is possible to restore it while maintaining alpha transparency.
It is a hack that relies on SetParent, because normally you can't use SetLayeredWindow on a child window of another window, you can only use it to top level windows.
Start a new project, add Frame1 and paste:
Happy hacking if someone catches this up and tries to get it to work.Code:Option Explicit
Private Const GWL_EXSTYLE = -20
Private Const GWL_STYLE = -16
Private Const LWA_ALPHA = &H2
Private Const WS_CHILD = &H40000000
Private Const WS_EX_LAYERED = &H80000
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Sub GetMem4 Lib "msvbvm60" (ByVal Ptr As Long, Value As Long)
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
Private Declare Function MoveWindow Lib "user32" (ByVal hWnd As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent 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 Sub Form_Resize()
Static lngWnd As Long, udtRect As RECT, udtRectP As RECT
Dim udtRectPN As RECT
If lngWnd = 0 Then
GetMem4 ObjPtr(Frame1) + 68, lngWnd
GetWindowRect lngWnd, udtRect
GetWindowRect Me.hWnd, udtRectP
SetParent lngWnd, 0
SetWindowLong lngWnd, GWL_EXSTYLE, GetWindowLong(lngWnd, GWL_EXSTYLE) Or WS_EX_LAYERED
SetLayeredWindowAttributes lngWnd, 0, 50, LWA_ALPHA
'MoveWindow lngWnd, udtRect.Left - udtRectPN.Left, udtRect.Top - udtRectPN.Top, udtRect.Right - udtRect.Left, udtRect.Bottom - udtRect.Top, 0
SetParent lngWnd, Me.hWnd
Else
GetWindowRect Me.hWnd, udtRectPN
udtRectPN.Left = udtRectP.Left - udtRectPN.Left
udtRectPN.Top = udtRectP.Top - udtRectPN.Top
'SetWindowLong lngWnd, GWL_EXSTYLE, GetWindowLong(lngWnd, GWL_EXSTYLE) And Not WS_EX_LAYERED
End If
SetWindowPos lngWnd, 1, udtRect.Left - udtRectPN.Left, udtRect.Top - udtRectPN.Top, udtRect.Right - udtRect.Left, udtRect.Bottom - udtRect.Top, 0
End Sub
Edit!
It still doesn't maintain zindex, but it is possible to have the transparent window behind other controls! Now the hard part is tracking window movement...
Framez doesnt support tooltiptext for labels does anyone know how to fix this issue?
I need that label for making check boxes and option boxes transparent.
Instead of tooltiptex from label i could show tooltiptext of check box or option if i know how to do that programically.
thx
That problem doesn't have anything to do with the Framez control in particular, if you create a new usercontrol and set it as a container you'll see the lable control (even if set to opaqe) doesn't show it's tooltip, though I'm not sure why.
Unless someone knows why and a solution I'd suggest trying something else for your tooltips, like a ballon tooltip class (copy of the class posted here) instead. You wont have that problem with labels then and have nicer looking tooltips also IMO.
btw, to use a label with that class you would pass the labels container handle since a label doesn't have a handle.
Thanks for your reply.
you can not use that class because labels has no hwnd but i solved the problem by placing the label inside the picturebox. I set the labels to transparent and i cut out picturebox from the backgrount so it all looks transparent and tooltip works fine on that.
You can use that tooltip class on labels, as I said you need to use the labels container hWnd.
I use this sub to set/show the tooltip, then use it like this...
EDIT btw, The Framez control posted here doesn't have a MouseMove event, which you'd most likely need so you can reset that balloon tip class.Code:' Lable1 inside Framez1 control...
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
ShowToolTip "ToolTip Here", Framez1.hWnd, "Title Here"
End Sub
Add a simple MouseMove event to the Framez control...
Code:' General Declares
Event MouseMove()
' code
Private Sub UserControl_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
RaiseEvent MouseMove
End Sub
Updated:
v1.14 - Fix(v1.12): Selecting a system color for XP\7 border color was always black.
v1.13 - Add option to disable transparency and set background color.
Note: Transparency is now disabled by default in v1.13 and later.
can you tell me how to apply it in my form if ever i want it to apply on my own form please?
can you tell me how to apply it in my own form...i try'd to add your ActiveX Control but its not working it keeps my frame in my form untransparent...what should i do?..please help me
Hi Edgemeal,
i played with your TabStrip Demo For WinXP. i like this, but actually i wanted my form is resizeable and the tabstrip and the frame as well. but when i use Form_Resize, then the frame is error, saying Can't create AutoRedraw image..
is there a way to solve this?
thank you very much..
yes it works as i wanted.. :D
thank you very much..
After years of searching, I finally found a transparent control.