473,811 Members | 3,687 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB 6 to VB.net converion form event behavioral problem

28 New Member
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.SetLabelP os()

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 1164
Joseph Martell
198 Recognized Expert New Member
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
4357
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: aDescriptions = split(request.form("strDescriptions"), ", ") The problem however is if a description contains a comma in the text,
1
1276
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 using the LOAD event for the form, the form was half-painted (if that makes sense) while the db call was being performed. I'd like the user to be able to look at a fully painted form (and hourglass cursor) while the call is being made.
0
1493
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)): Can anyone make any suggestions on how to do it ? Thanks
1
1446
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 not handle any event beyond that. What event should I use to handle Mdichild closing event. (i'm looking for mdichild form event, not event related to forms by name) MTIA,
7
1384
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 events. Or maybe there is a property for the Textboxes where I can set data entry conditions? Wondering about CausesValidation textbox property-how to use.
4
7858
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 Object, ByVal e As ...) Handles Form."EVENT HERE" dim Ok as Boolean = False ... If Not (ok = True) Then
11
1788
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, the button has a simple Click event. Under certain circumstances (haven't worked out exactly what they are yet, but it involves opening and closing a sub form). Pressing ENTER with the
5
1330
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 because I did not first remove or modify a UI element that was bound to a datalibrary and I had made some field changes in the datalibrary).Changing the line of code I just wrote does not allow me to go in the designer any more. The errors...
5
6447
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 datasheet doing data entry, I have put some validation code on the 'exit event' of each column to do some validation. The problem that I am having is that the user can enter data in COL1 or any COL and use the mouse to click into a different column so...
0
9605
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10647
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10384
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10395
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10130
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6887
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5553
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3865
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3017
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.