Solved

Return textbox from container in VB6

Posted on 2007-11-23
4
701 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…

820 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