Solved

WHy does this happen? Control Placment

Posted on 2002-03-19
6
129 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
Comment Utility
More complete codes ..
0
 
LVL 3

Expert Comment

by:Bahnass
Comment Utility
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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 69

Accepted Solution

by:
Éric Moreau earned 200 total points
Comment Utility
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
Comment Utility
emoreau - nice one! explains a lot.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

744 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

10 Experts available now in Live!

Get 1:1 Help Now