Solved

Return textbox from container in VB6

Posted on 2007-11-23
4
702 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
[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
  • 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 86

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

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!

Question has a verified solution.

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

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…
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.
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…
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…

734 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