|
So updating 400 textboxes takes 30 milliseconds.... well lets see... thats more than 13 textboxes updated in 1 thousandth of a second. I'd say that was pretty reasonable performance wouldn't you?
|
|
|
|
|
I know a language labVIEW doing this operation less than a millisecond. The reason am going for .Net is its multilingual capability.
I tried updating 400 textboxes without adding them to the Form.Controls. The same operation takes less than a millisecond. So I suspect the updation of the UI is causing the delay.
Thanks in advance
Nanda
|
|
|
|
|
Is there any possibility that you can replace the textboxes with a Datagrid?
You may use an array list or dataset as an datasource,
Updating the dataset or array list will automatically refresh the data within the grid...
|
|
|
|
|
You're updating every millisecond? You physically won't be able to see those changes so it is much more reasonable to expect your design to refresh every n milliseconds (you determine n), and log the data to an external source.
A better design though, would be to have each item exposed as a bindable object, and have a check on your property to say (effectively) if my new value is different from my old value, then update my new value and raise a PropertyChanged event on that property. This way, only those values that change get updated. Take a look at INotifyPropertyChanged for guidance on how to do this.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
getnanda@gmail.com wrote: updation of the values with millisecond accuracy is required
Are you planning to update the monitors too because a typical monitor will refresh the screen only one and three quarter times in the current time it takes to update all the text boxes.
If you update textboxes every millisecond the monitor will only have got 6% the way through a refresh before the thing is updated.
I really think some pragmatism is required here.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
Hi,
three comments:
1.
the system clock has a resolution of only 10 to 20 msec depending on hardware;
so I am not sure I trust your time measurement. See my timers article.
2.
400 textboxes is just silly. If all they do is show a little string, I suggest
you take them all out, and paint those strings directly to one big Panel, or
to the Form itself. That way you are in charge and not wasting any resources.
You can still have your own myTextBox class that has Location, Text and whatever
properties you like (less is more); plus a collection of those; then a Paint handler
that enumerates the collection and paints these "lightweight labels".
3.
I agree with who ever said updating a screen every msec does not make much sense,
so you might run your simulation at "full speed" and update the display say
every clock tick or every other clock tick.
You can do this by not calling Invalidate() when you change the drawing,
but instead have a periodic timer call Invalidate(). This works well together
with the lightweight labels.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I don't know who voted you a "1", but this suggestion would get far better performance than updating 400 textbox's (BTW, ridiculous!) individually.
|
|
|
|
|
such is life
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Don't worry, I five voted to balance this. Oh and point 3 was me.;P
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
So I returned the favor...
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Why thank you kind sir - but there was no need. I just thought your well balanced and well argued post needed to be 5ed.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
Use Temperory Table. Save all textbox values into that table. And finally use TableMapping for updating the Original database table.
Naresh Patel
|
|
|
|
|
Are you suggesting to use a database in order to speed things up
That's a novel approach...
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
When i call from C# some com - i need to know if i got S_OK or S_FAIL or S_FALSE -
How can i do it ?
I try to use Marshal object but how can i cant find it.
Thanks for any help.
|
|
|
|
|
If it's raised via a COMException, you just catch that. There is a gotcha however. See link[^].
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi, i have a c# windows application, from which the details can be exported to a Excel file. after exporting the application ask "Do you want to see the file". suppose the user clicks "yes", i want to show the file....
How can i open the file from the application?
My small attempt...
|
|
|
|
|
You can use OleDb driver to retrieve the data and display it using datagridview
|
|
|
|
|
What is this? please go through the question before you answer..... ok?
My small attempt...
|
|
|
|
|
I explained how you can show data from excel file in your application. If you want to open ms excel then use Process class and specify the path of file you want to open.
|
|
|
|
|
i just want to open the Excel file.... as (double cick).............. just to see the file
My small attempt...
|
|
|
|
|
Have a look at Process class
|
|
|
|
|
|
you can also take a look here.
Your problem is perhaps not so simple as you assume....
Ariadne
|
|
|
|
|
It was very easy and i did that.................
Process.Start(d:/..../sample.xls);
will solve the probelm
My small attempt...
|
|
|
|
|
Can any one help me how to do the validation for the Dynamically added control in the page which need to be validate?
for example i need to validate the textbox is empty ot not if empty i need to alert the user fill it out.
With Regards
Ganesan.S
Software Engineer
|
|
|
|