|
Right - here we go, and I'll try not to digress. You have a form that you don't want to be put on hold while you have something else going on, and you want to display a progress bar. Rather than trying to pass the form component to another thread, you should delegate the measurement code to a background thread and handle the update on the main UI. Using the BackgroundWorker class makes the whole issue really easy.
This[^] article gives a sample and was found by googling on BackgroundWorker and progressbar. There are many more examples there.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks, now I now what to look for
|
|
|
|
|
Hi
I am (as can be seen from my profile) an aspiring C# programmer/developer. I am living in the UK and am seeking to get in contact with other C# students or experienced programmers. I am close to London and would like to setup some kind of informal study groups with other C# students in the same area.
I am sure there must be people out there with similar needs.
I am currently using this forum to read about coding queries and the like but I would still like some live demonstrations or discussions.
Contact me here if you are interested.
Thanks
Francois Benadie
Francois Benadie
|
|
|
|
|
You should really post this in this[^] forum.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I would like to be able to invoke a button_clicked event via the function keys (F1, F2, etc.). Any links to articles or helpful code snippets would be greatly appreciated thanks everyone.
|
|
|
|
|
Handle the KeyDown event of the form which contains the button and test for the key that was pressed. If it is the function key you want to process, call the event handler of the button
|
|
|
|
|
I added the KeyDown event to the form, and added a breakpoint in the definition, and when I debug it isn't running when I press a key. *looks confused*
|
|
|
|
|
Examine the e.Keydata property in the event handler to see whether it is equal to functional key or not
|
|
|
|
|
I'm examining the keydata.. but the event isn't being triggered when I press a key. So, the code to examine the key is never running. I have a keydown method set up to run on the keydown event, but for some reason it isnt being executed when I press a key..
|
|
|
|
|
Set KeyPreview property of your form to true
|
|
|
|
|
Alternatively (if applying to a form with menus), add those commands to some menu in the
main menu, and give it the function keys as a shortcut. No coding required!
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
|
|
|
|
|
Hi all sorry for asking, but how do i calculate time"hh:mm:ss" / int(pages) *100.
for example 00:00:10 / 10 *100
Gonna count the time of 100 pages...
big reggards!!
Thanks
|
|
|
|
|
andredani wrote: Hi all sorry for asking, but how do i calculate time"hh:mm:ss" / int(pages) *100.
for example 00:00:10 / 10 *100
Gonna count the time of 100 pages...
Have you taken a look at the DateTime and TimeSpan classes? I suspect that would provide you with the answer.
Good Luck!
It isn't enough to do well in life.
One must do good when and where one can.
Otherwise, what's the point?
|
|
|
|
|
I'd go with what Matthew said.
But why are you multiplying the pages by 100?
Using pseudo-code, you've written:
TimeSpent / NrOfPages * 100
Best regards!
-Larantz-
|
|
|
|
|
The TimeSpan structure has a Ticks property that gives you the time as a long value, and a constructor that takes a long value.
Example:
TimeSpan duration = new TimeSpan(0, 0, 10);
int ticks = (int)duration.Ticks;
int pages = 10;
int calculatedTicks = ticks * 100 / pages;
TimeSpan calculatedTime = new TimeSpan((long)calculatedTicks);
---
single minded; short sighted; long gone;
|
|
|
|
|
I am currently working on a project to develop an application which employees will use to clock in, clock out on break, clock in after break, do the same for lunch, and clock out for the end of the day. This application will record time an employee works, calculate regular and over time then prepare a report for HR so employees can get paid. HR is also able to correct any error the employee may had made, e.g. forgot to log out or login. Employees work by shift thus an employee may start working on one date and end on the following date. I was thinking about creating the calculation logic in SQL as a stored procedure but was advised that doing so may not be best idea. I am not sure where to start on this, besides creating the tables needed for the project in SQL. Any sample or advice on this issue will be greatly appreciated.
Skan
If you knew it would not compile why didn't you tell me?!?!?!
|
|
|
|
|
A simple search will reveal a plethora of examples. It's a common homework assignment.
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: It's a common homework assignment.
Which is what this would seem to be.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I like to display a text so that one can expand and minimize the chapters of the text.
Like it's done in visual studio 05 in source code view, the methods can be expanded with the + sign.
Hope someone can give me a hint! Thanks.
|
|
|
|
|
AJAX is your answer I believe.
|
|
|
|
|
Ok, but there must be a way to do it with C# or C I belive.
|
|
|
|
|
Hi everybody,
Why do we need those @ # ~ signs in Responce.Redirect(@"../somefolder/somefile.aspx") kind usage.?
what is the difference between them in coding?
Thanks in advance
|
|
|
|
|
|
so why is it
"~/user/" + Request.QueryString["Userid"].ToString() + ...
sometimes?
why is that ~ sign for?
|
|
|
|
|
ASP.NET resolves the ~ operator to the root of the current application.
A search of MSDN will answer these questions also, and provide you with more information.
only two letters away from being an asset
|
|
|
|