473,549 Members | 2,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Public Sub New() in Windows Form Designer generated code

Hi

I've realised that whenever I declare this sentence, "dim newform as new
mainform" in another form, the Public Sub New() in Windows Form Designer
generated code in mainform will automatically run.

May I know is there a way to prevent it running again. Thanks.

Regards
Melson
Nov 21 '05 #1
1 1476
Whats happening here is New is being run to construct that particular
instance of your form. You do not want to prevent this happening.


"Melson" <we****@hotmail .com> wrote in message
news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
Hi

I've realised that whenever I declare this sentence, "dim newform as new
mainform" in another form, the Public Sub New() in Windows Form Designer
generated code in mainform will automatically run.

May I know is there a way to prevent it running again. Thanks.

Regards
Melson

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2025
by: DraguVaso | last post by:
Hi, I'm having some weird behaviour, and I can't find any solution to this. I made a UserControl (uclCommands) which contains a Toolbar (ToolBar1) with Modifiers = Public. I put this usercontrol on my form and call it Ucl1. In the Property Window in the Windows Forms Designer I change Ucl1.ToolBar1.ButtonSize to a bigger value.
2
1837
by: Ralph Wiggum | last post by:
I have created a control in C# and it works a treat, however, when I drop the control into a C# Windows Forms application, it does a very odd thing. It creates the control in design mode, but when I run the application, the control is nowhere to be seen. Looking at the form designer generated code in the InitializeComponent function, it has...
2
1785
by: MadMikey | last post by:
Can I change the order that controls are defined, or built, in the "Windows Form Designer generated code" section? I'm using VB.NET 2003. I have a custom control, that due to licensing restrictions, it must be defined before another "container" control on my form. I can manually move the code to where I need it, and successfully build my...
4
3770
by: gsilvey | last post by:
Is there a way to rebuild the code that is generated by the forms designer? It compiles, but it seems to have controls left in it that I previously removed using the designer. I'd like to just rebuild it all to ensure it is clean and does not have unnecessary code in it. (The Rebuild command does not do this.)
1
3238
by: RSH | last post by:
Hi, I have a situation where I have a Windows Form and I have 2 classes defined in the code, the primary form and a class that I got from the internet. I have a label in the form that I would like the 2nd class to write to...so I declared the label as "Public Shared". Which worked, I can write to it. But I get an error when closing down...
1
2364
by: beniro | last post by:
Hello, all. I'm implementing LinkPoint API on my site, but I have an error coming up in their code, and I'm wondering if anyone could give me any guidance on this one. Here is the specific error: Microsoft VBScript compilation error '800a03f2' Expected identifier /fsboms/newuser.asp, line 141
13
5229
by: cj | last post by:
In a project done in 2003 about a year ago I was told to add the SocketWrench code below into the Windows Form Designer generated code area as shown below. #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer.
13
1354
by: active | last post by:
With VS2005 the windows form designer uses the files *.Designer.vb I hope no one at MS is reading this because I know it will upset them to know - I like the old way better! I've been looking at the Options available for the Windows Form Designer and do not see one that would give me the older method. Is there such an option?
8
2304
by: TomC | last post by:
I want to bypass the Windows Form Designer in VS, to create a form programmatically. The elements of the form are to be arranged in a table, and I want the size of the table (and therefore the number of elements) to be determined at runtime, so dragging and dropping on the Form Designer won't cut the mustard. I'm coming from a Java...
0
7518
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7446
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...
0
7715
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. ...
1
7469
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...
0
6040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5087
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...
0
3498
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...
0
3480
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.