Click here to Skip to main content
15,924,507 members
Home / Discussions / C#
   

C#

 
GeneralRe: Need Help Pleaaase Pin
Anonymous27-Jun-04 13:05
Anonymous27-Jun-04 13:05 
GeneralRe: Need Help Pleaaase Pin
Dave Kreskowiak27-Jun-04 14:37
mveDave Kreskowiak27-Jun-04 14:37 
Generalfirewall Pin
shahrokh nabavi27-Jun-04 2:04
shahrokh nabavi27-Jun-04 2:04 
GeneralRe: firewall Pin
leppie27-Jun-04 3:55
leppie27-Jun-04 3:55 
GeneralRe: firewall Pin
Colin Angus Mackay28-Jun-04 0:39
Colin Angus Mackay28-Jun-04 0:39 
GeneralRe: firewall Pin
JimRivera28-Jun-04 16:14
JimRivera28-Jun-04 16:14 
GeneralDesigners serialization and code generation Pin
Jon_Slaughter27-Jun-04 1:19
Jon_Slaughter27-Jun-04 1:19 
GeneralRe: Designers serialization and code generation Pin
Heath Stewart27-Jun-04 17:54
protectorHeath Stewart27-Jun-04 17:54 
The fact of the matter is that you can't control how the designer does things, only how it interacts with your code. In fact, in many of the more well-written topics in the .NET Framework SDK covering design-time functionality, this is basically stated.

Serialize is called on any container being designed (if applicable) when anything happens because the source code must be kept in-sync.

The fortunate thing is that controls are instantiated as they would be at runtime by the designer. If you want to keep track of information about a control (such as how many are created), then add a static field (probably a private static field) and increment that in your constructor. You can also decrement that in the finalizer (written in descructor notation as ~<classname()>) or implement IDisposable, which the designer should call when done with your object (you can never be gauranteed of when the finalizer is called by the GC).

Still, though, a collection (ICollection implementation, presumably) has a Count property. The kth element is Count - 1. Why can't you use that for whatever you're doing? And the order of the controls if the order in which they were added (unless you inserted a control before the end of the collection, of course).

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Designers serialization and code generation Pin
Jon_Slaughter27-Jun-04 19:51
Jon_Slaughter27-Jun-04 19:51 
GeneralRe: Designers serialization and code generation Pin
Heath Stewart28-Jun-04 3:31
protectorHeath Stewart28-Jun-04 3:31 
GeneralRe: Designers serialization and code generation Pin
Heath Stewart27-Jun-04 18:47
protectorHeath Stewart27-Jun-04 18:47 
QuestionHow to get device info using SetupDiGetDeviceInterfaceDetail? Pin
Pain_Elemental27-Jun-04 0:35
Pain_Elemental27-Jun-04 0:35 
AnswerRe: How to get device info using SetupDiGetDeviceInterfaceDetail? Pin
Heath Stewart27-Jun-04 18:12
protectorHeath Stewart27-Jun-04 18:12 
GeneralRe: How to get device info using SetupDiGetDeviceInterfaceDetail? Pin
Pain_Elemental27-Jun-04 19:52
Pain_Elemental27-Jun-04 19:52 
GeneralDataGrid :- Events Pin
jk chan26-Jun-04 22:48
jk chan26-Jun-04 22:48 
Generalaccess to controls of a project in another project Pin
fatidarya26-Jun-04 21:08
fatidarya26-Jun-04 21:08 
GeneralRe: access to controls of a project in another project Pin
Stefan Troschuetz26-Jun-04 21:20
Stefan Troschuetz26-Jun-04 21:20 
GeneralRe: access to controls of a project in another project Pin
fatidarya26-Jun-04 23:48
fatidarya26-Jun-04 23:48 
GeneralRe: access to controls of a project in another project Pin
Stefan Troschuetz27-Jun-04 0:12
Stefan Troschuetz27-Jun-04 0:12 
GeneralRe: access to controls of a project in another project Pin
fatidarya27-Jun-04 1:54
fatidarya27-Jun-04 1:54 
GeneralRe: access to controls of a project in another project Pin
Stefan Troschuetz27-Jun-04 2:07
Stefan Troschuetz27-Jun-04 2:07 
QuestionMail Checker 1.0 extension? Pin
razzeler26-Jun-04 18:08
razzeler26-Jun-04 18:08 
AnswerRe: Mail Checker 1.0 extension? Pin
Heath Stewart27-Jun-04 5:51
protectorHeath Stewart27-Jun-04 5:51 
Generalproxy pass https question Pin
steven shingler26-Jun-04 8:54
steven shingler26-Jun-04 8:54 
GeneralRe: proxy pass https question Pin
Heath Stewart26-Jun-04 14:36
protectorHeath Stewart26-Jun-04 14:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.