Click here to Skip to main content
15,916,951 members
Home / Discussions / C#
   

C#

 
GeneralRe: Textbox control [modified] Pin
alostdruid2-Feb-07 16:45
alostdruid2-Feb-07 16:45 
GeneralRe: Textbox control Pin
Luc Pattyn2-Feb-07 17:08
sitebuilderLuc Pattyn2-Feb-07 17:08 
GeneralRe: Textbox control Pin
Christian Graus2-Feb-07 17:21
protectorChristian Graus2-Feb-07 17:21 
QuestionRe: Textbox control Pin
alostdruid5-Feb-07 15:00
alostdruid5-Feb-07 15:00 
AnswerRe: Textbox control Pin
Christian Graus5-Feb-07 17:11
protectorChristian Graus5-Feb-07 17:11 
Questionaccess application settings in from code in windows application Pin
red60mans2-Feb-07 15:03
red60mans2-Feb-07 15:03 
QuestionArrays of structures (inside a structure) Pin
Kim Ferrari2-Feb-07 13:10
Kim Ferrari2-Feb-07 13:10 
AnswerRe: Arrays of structures (inside a structure) Pin
Luc Pattyn2-Feb-07 13:27
sitebuilderLuc Pattyn2-Feb-07 13:27 
MyState[] state;
is an array reference; it will start life with the value null ( compare to TextBox tb; )
You can assign something to it with code within a method, or as an initializer if
it is a member of a class, but not in a member of a struct (struct members dont take
an initializer)
In a struct, you should use a constructor if you need some data to be initialized inside
the definition of the struct.

So you could write:
public struct MyArray {
    MyState[] state; 

    public MyArray() {
        state = new MyState[100];  // square brackets !
    }
}

and there are some variations, you could get the size as a parameter in the constructor,
or you could create (=call new) the array at a later point in time, i.e. within the
code that uses your MyArray.

Smile | :)





Luc Pattyn

GeneralRe: Arrays of structures (inside a structure) Pin
Kim Ferrari5-Feb-07 12:51
Kim Ferrari5-Feb-07 12:51 
QuestionMouseClick event on wia video overlay Pin
stevva2-Feb-07 12:58
stevva2-Feb-07 12:58 
AnswerRe: MouseClick event on wia video overlay Pin
Luc Pattyn2-Feb-07 13:04
sitebuilderLuc Pattyn2-Feb-07 13:04 
GeneralRe: MouseClick event on wia video overlay Pin
stevva3-Feb-07 4:39
stevva3-Feb-07 4:39 
GeneralRe: MouseClick event on wia video overlay Pin
Luc Pattyn3-Feb-07 5:27
sitebuilderLuc Pattyn3-Feb-07 5:27 
GeneralRe: MouseClick event on wia video overlay Pin
stevva6-Feb-07 6:21
stevva6-Feb-07 6:21 
Questionprogress bar Pin
netJP12L2-Feb-07 10:46
netJP12L2-Feb-07 10:46 
AnswerRe: progress bar Pin
Christian Graus2-Feb-07 11:19
protectorChristian Graus2-Feb-07 11:19 
GeneralRe: progress bar Pin
netJP12L2-Feb-07 11:31
netJP12L2-Feb-07 11:31 
GeneralRe: progress bar Pin
Christian Graus2-Feb-07 11:44
protectorChristian Graus2-Feb-07 11:44 
GeneralRe: progress bar Pin
netJP12L2-Feb-07 11:46
netJP12L2-Feb-07 11:46 
GeneralRe: progress bar Pin
Luc Pattyn2-Feb-07 13:08
sitebuilderLuc Pattyn2-Feb-07 13:08 
GeneralRe: progress bar Pin
Christian Graus2-Feb-07 15:54
protectorChristian Graus2-Feb-07 15:54 
Questionmouse position Pin
negar soleimani2-Feb-07 10:28
negar soleimani2-Feb-07 10:28 
AnswerRe: mouse position Pin
Luc Pattyn2-Feb-07 10:31
sitebuilderLuc Pattyn2-Feb-07 10:31 
QuestionHow do I cast a string to type System.Windows.Forms.MessageBoxButtons Pin
Vernware2-Feb-07 10:25
Vernware2-Feb-07 10:25 
AnswerRe: How do I cast a string to type System.Windows.Forms.MessageBoxButtons Pin
Luc Pattyn2-Feb-07 10:39
sitebuilderLuc Pattyn2-Feb-07 10:39 

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.