?
Solved

WHy does this happen? Control Placment

Posted on 2002-03-19
6
Medium Priority
?
136 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 53

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
Technology Partners: 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 600 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…
Suggested Courses

771 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