|
-
Feb 15th, 2019, 01:42 PM
#1
Thread Starter
Member
Re: Radio button list problem
Ohh, thank you very very much! You've helped me with a lot questions now I have a one more que. Whats the difference between Dim rb as List(of RadioButton), and Private rb as new List(Of RadioButtons)? So why did you told me to use Private instead of Dim?
-
Feb 15th, 2019, 01:47 PM
#2
Re: Radio button list problem
 Originally Posted by Daveeed
Ohh, thank you very very much! You've helped me with a lot questions now  I have a one more que. Whats the difference between Dim rb as List(of RadioButton), and Private rb as new List(Of RadioButtons)? So why did you told me to use Private instead of Dim?
In this case, there is no difference at all that I can point to. Some people have suggested that Dim could be treated as either Private or Public, depending on the situation, but I don't know whether or not that's true.
As a general rule, Dim is used for local variables (you don't get a choice), and either Public, Private, or Protected (that last one is quite rare) are used for variables outside of methods. You don't HAVE to do that, but if Dim can mean different things in different places, then Public and Private are just more explicit. There certainly isn't any harm to using Dim. I have an application that did that for all form level variables (the code was generated, not written), and I've never found any negative consequence from that.
My usual boring signature: Nothing
 
-
Feb 15th, 2019, 02:05 PM
#3
Thread Starter
Member
Re: Radio button list problem
I've replaced the list to this
Code:
Private rb(4) As RadioButton
, but it gives me again the same error,
Code:
Additional information: Object reference not set to an instance of an object.
, at the line
Code:
rb(1).Location = vb1.Location
. Now, everythings should be okay, whats the problem again?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|