Solved

Return textbox from container in VB6

Posted on 2007-11-23
4
699 Views
Last Modified: 2008-02-01
In my VB6 app, the user employs 'Drag & Drop' to move a textbox from its original position to one of 20 different picture boxes which act as containers.  I'd like to have a "restart" option for mid-game.  I tried to create a public module which, when called, would put all the textboxes back to their original (start) positions.  I tried to use code like:

            Form1.Title(0).Move 78, 102

to bring the textbox 'Title(0)' back to Left 78, Top 102 .  The code seems to be ignored.  Is there something special about 'Container' behavior which has to be released for my textboxes to move back where they started?  Is there some better way to restart - without 'End' ing the code, which I don't want to do.
0
Comment
Question by:wjshore
  • 2
4 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 20342322
It depends on how they go there. If they are the result of automatic hyphenation, go to Tools/Language/Hyphenation and clear the 'Automatic hyphenate document' checkbox.

Otherwise they can be removed with Find and Replace. The method depends on the type of Hyphen

Optional Hyphens           Find:^-
Non-breaking Hyphens   Find:^~
Typed in characters        Find:-
0
 
LVL 17

Expert Comment

by:Shanmuga Sundaram
ID: 20342334
Where did you try using this code.

Better try using this in Formload or formactivate event. Hope I understand your need.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 20342761
My apologies. My comment was obviously meant for another question.
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 20344726
"In my VB6 app, the user employs 'Drag & Drop' to move a textbox from its original position to one of 20 different picture boxes which act as containers."

So is the FORM or something else the container to start with?...

"Is there something special about 'Container' behavior which has to be released for my textboxes to move back where they started?"

How are you making the PictureBoxes the container for your TextBoxes?   You need to set the FORM? back as the container to reset them...otherwise you are likely just moving the TextBox out of the visible area of the PictureBox when you use the original coordinates.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

920 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

16 Experts available now in Live!

Get 1:1 Help Now