Solved

Return textbox from container in VB6

Posted on 2007-11-23
4
698 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
Comment Utility
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
Comment Utility
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
Comment Utility
My apologies. My comment was obviously meant for another question.
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
Comment Utility
"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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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

763 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

5 Experts available now in Live!

Get 1:1 Help Now