473,396 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

VB 6 to VB.net converion form event behavioral problem

Hi,

I am using VS 2008 conversion wizard to convert a VB6 project to VB.net 2008. I have encountered a problem in the converted VB.net project. The Load event of a ‘form’ is not rising (in a specific scenario) in the converted VB.net version in comparison to the previous (VB6) implementation. The problem scenario is when I call a subroutine “SetLabelPos()” in ‘form1’ from ‘MainForm’:

Form1.SetLabelPos()

In this function I set position of label on form1:

Label1.Top = 350

When this line executes it raises the load event of form1 (in VB6 and not in VB.net), which performs some lengthy tasks and then returns control to the next line in “SetLabelPos” subroutine.

I have attached a sample VB6 project with this post, which demonstrates the scenario. I need reasoning (as why the same code acts differently in .net version i.e. Load event of the form is not raised) and work around for this situation.

Thanks

Hassan
Attached Files
File Type: zip VB6 Demo Proj.zip (2.5 KB, 41 views)
Sep 8 '10 #1
1 1151
Joseph Martell
198 Expert 128KB
From MSDN documentation:

[Form.Load Event] occurs before a form is displayed for the first time.
It sounds like what you were depending on was a side-effect of the behavior of VB 6, specifically that handling a displayable object caused the containing form to be loaded.

If what you are after is doing some expensive initialization, then you could try explicitly calling a method that performs that initialization (besides load). It would give you finer control over when that code gets executed.
Sep 13 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: rhungund | last post by:
Hey all... I'm submitting various form variables as arrays, so when I do try to access them when the form is submitted, i do a split on the variable and pop it into an array. for example:...
1
by: Will | last post by:
Hi All, I'm trying to find the correct form event to use to make a call to a database AFTER my form has been completely painted. The call to the database takes a few seconds and when I tried...
0
by: Venus | last post by:
Hello, After trying some ways to do it I wanted to use something like the code below but for some reason is not working (I have to generate the entire form dynamically (not only the controls)):...
1
by: al | last post by:
Hi, I have MDI form with 4 mdichild forms. I would like to enable Windows menu-item as more than 1 mdichild form loads. The problem i'm having is when MdiChildActivate event is raised, it does...
7
by: Rich | last post by:
Hello, I have 10 textboxes on a form. I would like to validate text-data entry on each textbox. I was looking for a Form_Current event or Form_Change event but did not recognize any such...
4
by: Volker Jobst | last post by:
Hi, Is there an event of windows.forms.form which informs me that the active control will be changed before it will be changed? Something like: Private Sub Form_Validating(ByVal sender As...
11
by: ChrisM | last post by:
Hi, Don't know if anyone can cast any light on this... I have a fairly complex C# WinForm with (amongst other) a text box and a button. The TextBox has events declared for KeyUp and KeyDown,...
5
by: Bob | last post by:
I made a code change to a form , then saved it and tried to go to design mode in the form. I get an error message (there seems to be a dataset defintion that can no longer be initialled apparently...
5
by: ncsthbell | last post by:
I hope I can explain this to make sense..... I have a form (datasheet) and the record source is TABLEA. TABLEA has 3 columns defined as required keys, COL1, COL2, COL3. When user is in row in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.