?
Solved

How Does the object.Show() event work in VS2010 (VB.Net) work

Posted on 2013-01-14
4
Medium Priority
?
340 Views
Last Modified: 2013-01-15
I am not a trained programmer but have learnt on the job with VB6 (and other languages) .  I supervised the writing of and have modified a VB6 enterprise program over the last 15 years.  It is still currently in production and but can no longer be supported in the direction the company is moving.  OS upgrades are slowly killing it.

I converted the program to VS2010, and whilst I can fix most control issues am having problems in displaying called forms from the mdiform that is master form for the program.  I had to recreate the mdiform from scratch to ensure it worked OK. (Just menubar, toolbar and status bar controls.)

Normally in VB6 when I hit a .show()  event I was able to step into the called form and step through the code, however in VS2010 when I hit the event, no form is displayed and often as not the mdi form also shuts down.

When I recreate a form in VS2010 it sometimes can be shown but again a 50-50 success rate.  Can someone explain to me how the show() event works as not much sensible information on the internet.  Is there some simple solution to showing the called forms as I have 77 forms to recreate  an 98 CR reports to re-engineer?   Or would praying be better?

I have not attached any code yet as the data is too big.
0
Comment
Question by:Warwick_Radford
[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 83

Accepted Solution

by:
CodeCruiser earned 1500 total points
ID: 38774044
Show() is a method. Its a builtin method of the Form class so if we don't know what it does behind the scenes (unless we dig into it). Do you get any errors? Do you have any code in Load or Shown events of the child forms?
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 38774277
"I converted the program to VS2010"

The converter is awful, and doesn't always work correctly.

Start with a NEW project and manually create the events, copying over code to the correct places (and changing things as you go).

The Show() method works exactly as you'd expect.  It is most likely just a "corrupt" project from the conversion.
0
 

Author Comment

by:Warwick_Radford
ID: 38777306
Reply to both CodeCruiser and Idle_Mind.
Thank you both for answering.  It may be best and start a new project as it could be something wrong in any one of the forms that is affecting the viewing of any one particular form. I understand that.  I just thought that I might be able to get an idea how the show event worked that might make it easier to quickly fix each form. I now know that that was wishful thinking.   It may take too long to debug especially when using the backwards looking features of VS2010 and probably quicker to generate a brand new project.  I will have to bite the bullet and be a little later getting the software to client.
For Code_Cruiser:-  Normally I wouldn't get any error message, the called form just doesn't show and then the mdi form will shutdown.  This suggests to me that there is an internal corruption in the core of the converted program thus I may be better creating a new project.  If I did get any errors it was "Win32Exception was unhandled: Error creating window handle."
MSDN explanations of this error were virtually non-existant and the web not much better.
I think it may better to generate more code.  At least I dont have to recreate the 300 or so stored procedures that go along with this program.  Once again thank you both for your responses.
0
 

Author Closing Comment

by:Warwick_Radford
ID: 38777307
Sorry CodeCruiser  and Idle_Mind.  Should have answered through this method and not as a response.  Tried to accept both answers but trying to do them one at a time.  First time in this forum.  Will do better next time.
0

Featured Post

Independent Software Vendors: 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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

741 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