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
Solved

VB6 form: How change Container of control at run-time?

Posted on 2007-03-30
2
1,880 Views
Last Modified: 2013-12-20
On a complex VB6 form, how could I change a control (textbox etc) container from one container (e.g SSTab or Frame) to a different container on same form at run-time?
The Container Property seems to be read only....
0
Comment
Question by:mvanral
2 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 18823942
It works fine for me...

I put a CommandButton (Command1) and two Frames (Frame1, Frame2) on my form.  Then I placed a TextBox (Text1) into Frame1.

    Private Sub Command1_Click()
        Set Text1.Container = Frame2
    End Sub

When I click the button, the TextBox moved from Frame1 to Frame2.

You said you have a "complex VB6" form.  Could you explain in more detail?...

0
 

Author Comment

by:mvanral
ID: 18824048
Well, that worked, i feel a little silly... (and you lucky - for points)
i overlooked the "Set" and i then found information saying contained property "read-only"
It works - thx
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

856 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