Dim lbl( ) As Label = New Label( ){...} vs Dim lbl( ) As Label = {...}
From: Ron (anonymous_at_discussions.microsoft.com)
Date: 11/12/04
- Next message: Herfried K. Wagner [MVP]: "Re: Change the look of a button."
- Previous message: Derek Martin: "Stupid Combobox Question"
- Next in thread: Herfried K. Wagner [MVP]: "Re: Dim lbl( ) As Label = New Label( ){...} vs Dim lbl( ) As Label = {...}"
- Reply: Herfried K. Wagner [MVP]: "Re: Dim lbl( ) As Label = New Label( ){...} vs Dim lbl( ) As Label = {...}"
- Reply: Jay B. Harlow [MVP - Outlook]: "Re: Dim lbl( ) As Label = New Label( ){...} vs Dim lbl( ) As Label = {...}"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 12 Nov 2004 09:04:04 -0800
Hello,
I created an array of label controls like this:
Dim lbl() As Label = {Me.lbl1, Me.lbl2, Me.lbl3}
and was able to iterate through the array. But then I saw
another way to declare the same array:
Dim lbl() As Label = New Label(){Me.lbl1, Me.lbl2, Me.lbl3}
Both ways seems to work fine, but I want to get in the
practice of doing this correctly. Is there a difference
between using New or not for this? If so, what is the
difference?
Thanks,
Ron
- Next message: Herfried K. Wagner [MVP]: "Re: Change the look of a button."
- Previous message: Derek Martin: "Stupid Combobox Question"
- Next in thread: Herfried K. Wagner [MVP]: "Re: Dim lbl( ) As Label = New Label( ){...} vs Dim lbl( ) As Label = {...}"
- Reply: Herfried K. Wagner [MVP]: "Re: Dim lbl( ) As Label = New Label( ){...} vs Dim lbl( ) As Label = {...}"
- Reply: Jay B. Harlow [MVP - Outlook]: "Re: Dim lbl( ) As Label = New Label( ){...} vs Dim lbl( ) As Label = {...}"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|