|
Use AddRange.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
Move this line outside the loop
this.Controls.Add(lab[i]); and change it to
this.Controls.AddRange(lab);
|
|
|
|
|
They give the same result
|
|
|
|
|
The two pieces of code don't even do the same thing.
Why would you want to even create 3,000 labels for your form. I'd hate to see the UI with something like that.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Just for testing!
What about using StreamReader, BinaryReader, DataGridView, ListBox?
These classes and objects are common but these are not as fast as I need.
|
|
|
|
|
The .NET framework has put more funcionality into the Label object, so there is more overhead.
If all that you are going to do is to put ridiculous amounts of controls in the form, you can stick with VB6.
If you want to do something else, you can have very much use for it. For example, creating an instance of a class is considerably faster in C# compared to VB6.
You should also consider that VB6 is a dead language. There is no further development, and Microsoft doesn't support it any longer.
Pedram Behroozi wrote: Besides I have to insert approximately 100MB .Net Framework package in my installation package while I really don't need all of .Net Framework features
Where did you get hold of a 100 MB framework package? The .Net Framework 2.0 package is 22 MB.
Besides, you are comparing apples and oranges. There is a runtime library required for running VB6 programs also, the only difference is that VB6 is so old that the RTL has been included with every version of Windows for many years, just like the .NET framework 2 is included in Vista.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi there Pedram
Pedram Behroozi wrote: And my problem is speed!
Well, I think you have to use just C++
Pedram Behroozi wrote: C#: about 5seconds
VB6: less than a second!!!
I thought C# is faster
Pedram Behroozi wrote: Besides I have to insert approximately 100MB .Net Framework package in my installation package while I really don't need all of
You're right. It's very bad , because if we want to run our programs on the other systems , we have to install .Net framework
|
|
|
|
|
And if you want to run C++ applications, you have to install the C++ runtime. Hey, even VB has a runtime.
|
|
|
|
|
|
VB6 runtime is about 1.31 MB
|
|
|
|
|
But when I was working C++, I wasn't installing anything for running it on the destination system.
|
|
|
|
|
That's because, in a lot of cases, the runtime will already have been installed. Take a look at the msvcrt - that's the Microsoft Visual C++ RunTime. It's the same with .NET - over time, more and more systems will have .NET installed on them by default.
|
|
|
|
|
And to follow up with what Pete said, Vista has .NET pre-installed, just like XP has the C++ runtime (albeit an older one) pre-installed.
|
|
|
|
|
Judah Himango wrote: Vista has .NET pre-installed
Which version ?
|
|
|
|
|
Version 3.
On a related note, I understand Microsoft will be updating all .NET installations to .NET 3.5 SP1 later this year through Windows Update.
|
|
|
|
|
Well I think it's an Iranian problem!
In Iran we still use VBDOS, QBASIC and even GWBASIC. We still teaching these dead languages in our universities and... I don't want to vilify my country but it's a fact and our users don't interest in great .Net UI and features, based on this fact. They expect that application runs when they double-clicked on its icon without doing anything else, like installing!
Ok, I think I'm yacking.
Thank you all for helping.
|
|
|
|
|
Can someone help me or give me some sample code to read or display elements of an array (array could be one, 2,3, 4...dimensions). we need to read the array recursively and using not more than one loop. I don't know how to handle it. can someone shed some idea or code?
|
|
|
|
|
This sounds like a homework assignment, so I won't post the (easy) solution here.
Just one hint:
Loop over each item in the first dimension of the array and call this function recursively for each item.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
please helpme if you can. I will appreciate it.
|
|
|
|
|
He just did. he told you how to do it.
As has been said a thousand times, we'll help you do your homework but we wont do it for you!
|
|
|
|
|
With a little bit of thought you shouldn't need a loop at all. The real question is do you want to display the results, pre-order or post-order?
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
please help me if yiou have time. I have a big hope on this forum. I am entry level and not sr like you. please help and God will give it on return.
|
|
|
|
|
God helps those that help themselves. This isn't a Senior Developer problem, this is a trivial Freshman Comp Sci question that everyone gets in the first month of the course. Asking us for the answer is cheating and grounds for dismal at every University in the United States. How is giving you the answer helping anyone?
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: How is giving you the answer helping anyone?
By getting him kicked out of school for cheating, we won't have to clean up his 'work' after he graduates.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
What about inorder?
modified 12-Sep-18 21:01pm.
|
|
|
|