Re: [2.0] using with w/ c#
Assign comboBox1.Items to a local variable and then refer to it each time C# has no direct equivalent to With.
Re: [2.0] using with w/ c#
Assign comboBox1.Items to a local variable and then refer to it each time C# has no direct equivalent to With.
how? kindly help me?
Re: [2.0] using with w/ c#
Simply as JM said, there's no equivalent with With in C#. You more or less do it like this
foreach (string s in new string[] {"a", "b", "c"}) { combo.Items.Add(s); }
Re: [2.0] using with w/ c#
Quote:
Originally Posted by arshesander
Assign comboBox1.Items to a local variable and then refer to it each time C# has no direct equivalent to With.
how? kindly help me?
Think first, ask questions later. You already know how to declare a local variable and assign something to it.
Re: [2.0] using with w/ c#
Let's give him a break, I think he really doesn't understand.
Here it is:
Code:
ObjectCollection o = comboBox1.Items;
o.Add("Item 1");
o.Add("Item 2");
o.Add("Item 3");
Re: [2.0] using with w/ c#
Quote:
Originally Posted by BramVandenbon
Let's give him a break, I think he really doesn't understand.
I disagree. I think people have a tendency to assume they don't understand without considering the problem properly. I very much doubt that arshesander has made it this far without having had to declare a local variable and assign a value to it. You may prefer to hand over a fish but I prefer to push people to learn to fish for themselves, especially when they already know how but don't realise it. In the long run that is more beneficial to someone's learning.
Re: [2.0] using with w/ c#
I'll have to agree, this was way too simple to not understand.