Solved

WHy does this happen? Control Placment

Posted on 2002-03-19
6
133 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 51

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 70

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

756 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