Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Positioning a calendar (OLE) control

Status
Not open for further replies.

mpgalvin

Programmer
Feb 5, 2001
119
IE
I have an invisible calendar control on my form, which is made visible when a button is clicked. When the control is made visible, I'm setting its position like so:
Code:
with this.parent.calendar
     .left    = 236
     .top     = 107
     .height  = 156
     .width   = 283
     .visible = .t.
endwith
However, when I run the form, only the height and width properties are set - top and left are as they are in form-design. And I have no idea why!

It's not a major problem, because I can just put the calendar control exactly where I want it to appear in design-mode, but it'd be nice to know if it's me...
 
I assume you're doing a thisform.refresh after resetting the position? --Dave
 
Is your control directly on the form or is it place inside a container.

if it is inside a container, strange visual effects can happen. I once wrote a tip about it in FoxPro Advisor.

When in a container the trick is to make the control invisible and visible again to make it repaint correctly after you have moved it (becuuase the user has resized the form for instance).

If it is place directly on the form then a refresh could help..but that is jsut a guess...

HTH,
Weedz (Wietze Veld) They cling emotionally to code and fix development rather than choosing practices based on analytical assesments of what works best. - Steve McConnell
 
Nope, niether of these good ideas appear to make any difference. I now have 2 forms doing the same sort of thing. In 1, the control is on a container, but in the other, it's directly on the form, and both have the same problem.

Weedz, not sure what you mean by making the control invisible and then visible again. It's already invisible to begin with.

I wonder if the order of the properties makes any difference? Should it be made visible, then moved? Should it be done alphabetically :)?
 
I suggest you put the codes in the init event of the calendar control

WITH This.
.left = 236
.top = 107
.height = 156
.width = 283
.visible = .t.
ENDWITH

ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top