?
Solved

Return textbox from container in VB6

Posted on 2007-11-23
4
Medium Priority
?
704 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…
Suggested Courses

719 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