Visual Basic Foro
Programación => Visual Basic 6 => Mensaje iniciado por: swerd en Diciembre 26, 2012, 11:07:29 am
-
Hello and Feliz Navidad,
I found the ClsButtonNC, I like it.
I would like to use a button looks like regular Window button, e.g. Minimize, picture is no problem.
The problem I have is, I like place this new button left to the button Minimize.
Hove I can move the ClsButtonNC button to this place?
Best Regards
swerd
-
Hi Swerd , welcome to the forum.
see this
Set cButtonNC1 = New ClsButtonNC
With cButtonNC1
.CreateButton Me.hWnd, "Hide"
.LoadImageFromFile (App.Path & "\Flecha.png")
.Right = -110
.Top = 0
.MoveMode = TopRight
End With
the measures began to eye, but surely there is a way to calculate the size of Bontes close, minimize, maximize
-
Hello Leandro,
tnx for the answer.
In my tests I used .MoveMode = TopRight and the button was on the right side.
Then I used the minus value to move to the left, but the button stayed on the right.
At the moment I do not remember where I placed the minus value.
In the next week I will be back home, then I will try your advice.
But before this I've got one question more.
In Form_Resize(),
there is also
cButtonNC1.Left = BorderWidth
Shall I change it to cButtonNC1.Right?
Shall I replace the BorderWidth by the same value -110?
Best Regards
swerd
-
Happy New Year.
It works, thanks.
The problem was, I changed .MoveMode to TopRight, but did not change .Left to .Right, and then I tried with values in Form_Resize.
This worked with .Left, (button was moved), but not with .Right.
Now it works, the button is related to the right side and can be moved.
But the original problem was (is), on a XP the project name Proyecto1 will be displayed in title line, but on W7 not, there in no project name.
I thought this happens because the ClsButtonNC is related to the left side, and if I will relate it to the right, then left side will stay free and Proyecto1 will be displayed.
I was wrong, Proyecto1 will be not displayed too.
Probably it is not possible.
If you have an idea how to view the project name on W7, I will be glad to have your advise.
Thanks again
swerd
-
Hi, I can hardly understand him, could put a screenshot
-
You are right, pictures can better explain.
1. On XP with the ClsButtonNC.cls active the text “Form1” is visible
XP-ClsButtonNC-on.png
(http://s9.postimage.org/3s75wg8y3/XP_Cls_Button_NC_on2.jpg) (http://postimage.org/image/3s75wg8y3/)
2. On W7 with the ClsButtonNC.cls not active the text “Form1” is visible
W7-ClsButtonNC-off.png
(http://s2.postimage.org/cr0mbflyt/W7_Cls_Button_NC_off2.jpg) (http://postimage.org/image/cr0mbflyt/)
3. On W7 with the ClsButtonNC.cls active the text “Form1” is not visible
W7-ClsButtonNC-on.png
(http://s14.postimage.org/gnva0h76l/W7_Cls_Button_NC_on2.jpg) (http://postimage.org/image/gnva0h76l/)
The question is, how to display the text “Form1” on W7 with activated ClsButtonNC.cls?
swerd
-
aaaa easy
remove this code
If WindowVersion > 5 Then 'Window Vista or Seven
'En windows Vista o Seven quita el icono, el caption,el SysMenu, y la Ayuda
Dim uWTAO As WTA_OPTIONS
With uWTAO
.dwFlags = WTNCA.VALIDBITS
.dwMask = WTNCA.VALIDBITS
End With
SetWindowThemeAttribute Me.hWnd, WTA_NONCLIENT, uWTAO, LenB(uWTAO)
End If
-
Oh, it's very easy, now I see this too, and it works too.
Tnx Leandro for the info.
swerd