473,657 Members | 2,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I think this is an easy one!

I have the following at the start of a class.

Seems to me I could delete everything except the New method.

Is that correct?

I can't imagine why not but since the IDE put it there I'd like some
reassurance.

Thanks

Inherits System.Windows. Forms.ComboBox

#Region " Windows Form Designer generated code "

'Required by the Windows Form Designer

Private components As System.Componen tModel.IContain er

Public Sub New()

MyBase.New()

InitializeCompo nent()

End Sub

'UserControl1 overrides dispose to clean up the component list.

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

If disposing Then

If (components IsNot Nothing) Then

components.Disp ose()

End If

End If

MyBase.Dispose( disposing)

End Sub

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

<System.Diagnos tics.DebuggerSt epThrough()Priv ate Sub InitializeCompo nent()

Me.SuspendLayou t()

Me.ResumeLayout (False)

End Sub

#End Region
Mar 25 '07 #1
6 1040
Active,

Yes,

With a shared class as well the new method, but in my eyes is that no class.

Cor
" active" <ac********** @a-znet.comschreef in bericht
news:es******** ******@TK2MSFTN GP06.phx.gbl...
>I have the following at the start of a class.

Seems to me I could delete everything except the New method.

Is that correct?

I can't imagine why not but since the IDE put it there I'd like some
reassurance.

Thanks

Inherits System.Windows. Forms.ComboBox

#Region " Windows Form Designer generated code "

'Required by the Windows Form Designer

Private components As System.Componen tModel.IContain er

Public Sub New()

MyBase.New()

InitializeCompo nent()

End Sub

'UserControl1 overrides dispose to clean up the component list.

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

If disposing Then

If (components IsNot Nothing) Then

components.Disp ose()

End If

End If

MyBase.Dispose( disposing)

End Sub

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

<System.Diagnos tics.DebuggerSt epThrough()Priv ate Sub
InitializeCompo nent()

Me.SuspendLayou t()

Me.ResumeLayout (False)

End Sub

#End Region


Mar 25 '07 #2
Try it and find out. :=)

" active" <ac********** @a-znet.comwrote in message
news:es******** ******@TK2MSFTN GP06.phx.gbl...
>I have the following at the start of a class.

Seems to me I could delete everything except the New method.

Is that correct?

I can't imagine why not but since the IDE put it there I'd like some
reassurance.

Thanks

Inherits System.Windows. Forms.ComboBox

#Region " Windows Form Designer generated code "

'Required by the Windows Form Designer

Private components As System.Componen tModel.IContain er

Public Sub New()

MyBase.New()

InitializeCompo nent()

End Sub

'UserControl1 overrides dispose to clean up the component list.

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

If disposing Then

If (components IsNot Nothing) Then

components.Disp ose()

End If

End If

MyBase.Dispose( disposing)

End Sub

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

<System.Diagnos tics.DebuggerSt epThrough()Priv ate Sub
InitializeCompo nent()

Me.SuspendLayou t()

Me.ResumeLayout (False)

End Sub

#End Region


Mar 25 '07 #3
I'm not using it now but am saving it.

"Earl" <br******@newsg roups.nospamwro te in message
news:uf******** ******@TK2MSFTN GP05.phx.gbl...
Try it and find out. :=)

" active" <ac********** @a-znet.comwrote in message
news:es******** ******@TK2MSFTN GP06.phx.gbl...
>>I have the following at the start of a class.

Seems to me I could delete everything except the New method.

Is that correct?

I can't imagine why not but since the IDE put it there I'd like some
reassurance.

Thanks

Inherits System.Windows. Forms.ComboBox

#Region " Windows Form Designer generated code "

'Required by the Windows Form Designer

Private components As System.Componen tModel.IContain er

Public Sub New()

MyBase.New()

InitializeComp onent()

End Sub

'UserControl 1 overrides dispose to clean up the component list.

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

If disposing Then

If (components IsNot Nothing) Then

components.Dis pose()

End If

End If

MyBase.Dispose (disposing)

End Sub

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

<System.Diagno stics.DebuggerS tepThrough()Pri vate Sub
InitializeComp onent()

Me.SuspendLayo ut()

Me.ResumeLayou t(False)

End Sub

#End Region



Mar 25 '07 #4
Thanks

"Cor Ligthert [MVP]" <no************ @planet.nlwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
Active,

Yes,

With a shared class as well the new method, but in my eyes is that no
class.

Cor
" active" <ac********** @a-znet.comschreef in bericht
news:es******** ******@TK2MSFTN GP06.phx.gbl...
>>I have the following at the start of a class.

Seems to me I could delete everything except the New method.

Is that correct?

I can't imagine why not but since the IDE put it there I'd like some
reassurance.

Thanks

Inherits System.Windows. Forms.ComboBox

#Region " Windows Form Designer generated code "

'Required by the Windows Form Designer

Private components As System.Componen tModel.IContain er

Public Sub New()

MyBase.New()

InitializeComp onent()

End Sub

'UserControl 1 overrides dispose to clean up the component list.

Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)

If disposing Then

If (components IsNot Nothing) Then

components.Dis pose()

End If

End If

MyBase.Dispose (disposing)

End Sub

'NOTE: The following procedure is required by the Windows Form Designer

'It can be modified using the Windows Form Designer.

'Do not modify it using the code editor.

<System.Diagno stics.DebuggerS tepThrough()Pri vate Sub
InitializeComp onent()

Me.SuspendLayo ut()

Me.ResumeLayou t(False)

End Sub

#End Region



Mar 25 '07 #5
active wrote:
I have the following at the start of a class.
Seems to me I could delete everything except the New method.
Is that correct?
No.
Inherits System.Windows. Forms.ComboBox
This says that your class inherits from ComboBox. That means it "looks"
and "acts" like a ComboBox (i.e. you can put it on a Form and it will
"appear", you can add items to it, etc., etc.). Without this, your
class inherits from Object, which can;t do any of that.
#Region " Windows Form Designer generated code "
You /could/ consider removing this, but don't be surprised if the Forms
Designer puts it back in!
'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er
Take this out and you won't be able to "edit" your Control in the
Designer any more.
Public Sub New()
MyBase.New()
InitializeCompo nent()
End Sub
OK, /this/ you need.
'UserControl1 overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
. . .
End Sub
All of this seems to be required for your Control to get "tidied" up in
the /same/ way as every /other/ Windows Control.
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Hah!
<System.Diagnos tics.DebuggerSt epThrough()Priv ate Sub InitializeCompo nent()
Me.SuspendLayou t()
Me.ResumeLayout (False)
End Sub
I'd be surprised if this is /all/ you have in here - the Designer likes
to dump all sorts of properties in here, almost for fun.
#End Region
See #Region

HTH,
Phill W.
Mar 26 '07 #6
Thanks Phill

"Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-kwrote in message
news:eu******** **@south.jnrs.j a.net...
active wrote:
>I have the following at the start of a class.
Seems to me I could delete everything except the New method.
Is that correct?

No.
>Inherits System.Windows. Forms.ComboBox
This says that your class inherits from ComboBox. That means it "looks"
and "acts" like a ComboBox (i.e. you can put it on a Form and it will
"appear", you can add items to it, etc., etc.). Without this, your class
inherits from Object, which can;t do any of that.
>#Region " Windows Form Designer generated code "
You /could/ consider removing this, but don't be surprised if the Forms
Designer puts it back in!
>'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er
Take this out and you won't be able to "edit" your Control in the Designer
any more.
>Public Sub New()
MyBase.New()
InitializeCompo nent()
End Sub
OK, /this/ you need.
>'UserControl 1 overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
. . . End Sub
All of this seems to be required for your Control to get "tidied" up in
the /same/ way as every /other/ Windows Control.
>'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Hah!
><System.Diagno stics.DebuggerS tepThrough()Pri vate Sub
InitializeComp onent()
Me.SuspendLayou t()
Me.ResumeLayout (False)
End Sub
I'd be surprised if this is /all/ you have in here - the Designer likes to
dump all sorts of properties in here, almost for fun.
>#End Region
See #Region

HTH,
Phill W.

Mar 26 '07 #7

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

Similar topics

4
1861
by: AF | last post by:
XOOPS - Anyone using it? What do you think of it? Thanks. Cheers to everyone, Al http://www.discountdrivingschool.com
72
4819
by: The Plankmeister | last post by:
Is doing this bad: <h3>Some title or other...<a href="#pagetop">back to top</a></h3> I have a feeling it is... My problem is I'm using CSS to style the H3 into a block that spans the whole containing element. I would like the <a> to appear next to the title, but I'm sure this is bad practice (for screen readers and heading-level navigation etc etc) So... is it acceptable to do this:
50
2455
by: jbailo | last post by:
Subject: dotnet is a farce. You know, I was always impressed with the way one could write a http program with c# or java. To me, it showed how 'superior' these languages are because they made it so 'easy' to set up connection points, open a socket, send the request.
13
1265
by: yoyoyo | last post by:
hi everybody! i'm trying to learn javascript in order to build a function that i need to put in my website.. since i have not so much time to do that i decided to ask to u in the net..probably for u is very easy to tell me how i have to do (and maybe someone of u also has the code..it would be great!) the function i need is the following: i have a tree with one or more root folders; each of those folders can contain another folder,...
8
1401
by: Xander | last post by:
I want to start an open knowledgebase about the .NET platform. A knowledgebase that is content-editable by everyone. Just have a look at www.dotnet4all.com for an example. What do you think about this initiative and is it worth anything for us developers? Xander
53
3160
by: jaso | last post by:
Can you give any comments on this code? I used one goto, is it bad? #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> #include <assert.h> #define NOT_NULL 1
15
2586
by: Andy Mabbett | last post by:
Google finds: Results 1 - 20 of about 34,000 linking to http://www.w3.org/WAI/WCAG1AAA-Conformance -- Andy Mabbett Say "NO!" to compulsory ID Cards: <http://www.no2id.net/> Free Our Data: <http://www.freeourdata.org.uk>
22
4016
by: semedao | last post by:
Hi , I am using asyc sockets p2p connection between 2 clients. when I debug step by step the both sides , i'ts work ok. when I run it , in somepoint (same location in the code) when I want to receive 5 bytes buffer , I call the BeginReceive and then wait on AsyncWaitHandle.WaitOne() but it is signald imidiatly , and the next call to EndReceive return zero bytes length , also the buffer is empty. here is the code: public static byte...
10
2615
by: Marek Zawadzki | last post by:
Hi all. Is it possible to implement an accurate voting mechanism (think digg.com) that does not require users to sign in before voting? I think for many people registering is pain and thus they rarely give their votes online. Just look at digg and compare the number of votes to the number of people visiting their website. IOW what if somebody needs votes but cannot afford to bother users with registration process?
0
8402
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8508
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
8608
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
7341
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6172
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5633
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
4164
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...
1
2733
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1627
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.