Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to find height of toolbars
Message
De
06/01/2005 18:54:34
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
00974203
Message ID:
00974899
Vues:
31
Thanks for sticking with me. I was able to get this to work with Dorin's help. There was a couple of sysmetric() sizes I was missing.

I was using a container with a textbox in it.

>What method of the datecontrol has this code? And what kind of object is the datecontrol? I'd like to try to reproduce this if I can. Since you said that there's a button that brings up the second form with the calendar, does that mean the button is calling a method in the datecontrol that has this code in it?
>
>One thing about this code that's confusing is that you're using variables with "Screen" in the name to represent both Screen attributes (lnScreenHeight) and attributes of the current form (lnScreenTop).
>
>There's also some logic that doesn't make sense. You're using the screen height to make sure there's enough room for the calendar control below the datecontrol, but if there's not enough room why are you taking the MAX(lnTop+lnScreenTop,0)? Wouldn't lnTop+lnScreenTop always be greater than 0? And if there is enough room...your calculation for the top of the calendar doesn't make sense to me. I understand lnTop+lnScreenTop (the absolute top of the datecontrol), but why are you subtracting this.height? I would think you'd want to add it so the calendar is below the datecontrol, not covering it. And why are you subtracting the height of the calendar control?
>
>>Here is my code. As I said, I am not worring about the left property yet. "this" = the datecontrol. "this.ocal" stores the calendar form object.
>>
>>
>>LOCAL lnTotBottom,lnFormWidth , lnTop, lnLeft, lnScreenHeight
>>WITH this.ocal
>>	lnTop = OBJTOCLIENT(this,1)
>>	lnScreenTop = OBJTOCLIENT(thisform,1)
>>	lnLeft = OBJTOCLIENT(this,2)
>>	lnScreenLeft = OBJTOCLIENT(thisform,2)
>>	lnScreenHeight = _screen.Height
>>	lnScreenWidth = _screen.Width
>>	.left = MIN(lnScreenWidth-.width,lnLeft+lnScreenLeft)
>>	lnTotBottom =lnScreenHeight - (lnTop+lnScreenTop+this.Height)
>>	IF lnTotBottom > .height
>>		.top = MAX(lnTop+lnScreenTop,0)
>>	ELSE
>>		.top = MAX(lnTop+lnScreenTop - this.Height - .height,0)
>>	ENDIF
>>	
>>ENDWITH
>>
>>
>>>>objtoclient(datecontrol,1)+objtoclient(thisform,1) works if there is not a toolbar. Otherwise I am to low about 30 pixels. Thus, how can I find the height of the toolbar. I figure that I have the same issue with the left property but lets take one at a time.
>>>>
>>>
>>>I guess I don't understand exactly what you're doing. I tried this with and without the standard toolbar showing, and although objtoclient returned different results, my code to calculate the top of the form didn't change, whether I used the Top property or objtoclient. I had the toolbar docked at the top of the screen. Where is the toolbar that's causing the problem?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform