Solved

WHy does this happen? Control Placment

Posted on 2002-03-19
6
130 Views
Last Modified: 2011-09-20
Hi,

I start a new project

then draw an sstab control on the form.

I then select the second Tab of the tab control. (ie current tab = 2)


then I draw 2 command buttons on the tab control.

I stick the followig code in the from resize event of Form1.


SSTab1.Width = Form1.Width
Command1.Width = SSTab1.Width / 2
Command2.Left = Command1.Width


when the programme is executed

all seems well, the two command button can we seen when you select the second tab.

select the first tab

then resize the form

the command2 button shows up on the first tab.

It seem to have 'fallin out' of the tab  container.

Why does this happen?

Any hhelp greatly appericated
0
Comment
Question by:wegwong
6 Comments
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 6881754
More complete codes ..
0
 
LVL 3

Expert Comment

by:Bahnass
ID: 6882055
How SStab works ????


It simply change LEFT Property of controls in other tabs except current one to negative values to put them OUT SCREEN


Ur Code
Command1.Width = SSTab1.Width / 2
Command2.Left = Command1.Width


Gives
Command2.Left  a posiotive value always
So it pops on current tab

Should be
Command2.Left = Command1.left + SomeValueLessthanTabWidth
Hope I helped
0
 
LVL 1

Expert Comment

by:walbury
ID: 6882331
Hi,
I couldn't repeat it except by adding one of the command
buttons to the form and moving it over the tab (inotherwords not actually on/in the tab although it looks like it is). That being said I have in the past experienced similar behaviour but with heavy duty controls
like Rich text boxes and treeviews where they inexplicably
started showing up on the wrong tabs, especially on form resize events. This appeared to be a repaint problem with the tab control, from memory doevents fixed it.
So in summary, first check it is IN the correct tab.
Otherwise try doevents.
Cheers,
walbury
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 69

Accepted Solution

by:
Éric Moreau earned 200 total points
ID: 6882367
the sstab controls deals with the Left property of contained controls. you can't paly with this property without some caution. see http://support.microsoft.com/default.aspx?scid=kb;en-us;Q187562
0
 
LVL 1

Expert Comment

by:walbury
ID: 6882383
emoreau - nice one! explains a lot.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6882612
Please maintain your open questions:
Questions Asked 14
Last 10 Grades Given A A A B B A B A  
Question Grading Record 8 Answers Graded / 8 Answers Received


Anthony
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now