Solved

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

Posted on 2007-03-30
2
1,916 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 86

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

Industry Leaders: 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

Suggested Solutions

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

730 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