Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


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

Posted on 2013-01-14
Medium Priority
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.
Question by:Warwick_Radford
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
LVL 83

Accepted Solution

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

Author Comment

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.

Author Closing Comment

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.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

610 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