|
I have a progress bar on my first form (first form you see when application loads). What I want to happen is when the form opens for the progress bar to go up 10 every second until it gets to its maximum value of 100, stop and stay at maximum value then enable a button which is disabled.
Code on form load:
Timer time1 = new Timer();
time1.Interval = 10;
time1.Tick += new EventHandler(timer1_Tick);
time1.Start();
Code on timer tick:
progressBar1.Value += 1;
timer1.Stop();
Now the problem with this code, I get an error because the progress bar tries to go 1 higher than its maximum value and I can't figure how to get the progress bar to stop trying to go higher when its at its maximum value. I am not sure where to put the button enable code since there is something I am doing wrong here.
Next I have another button that when clicked I want it to close the form and open another form. I don't want the form to hide when closed but exit the form completly, but putting form1.close (); it won't work as its my first form, the whole app just exits. What should I do?
In the end we're all just the same
|
|
|
|
|
Dave McCool wrote: time1.Interval = 10;
that is 10 milliseconds.
Dave McCool wrote: progressBar1.Value += 1; timer1.Stop();
so it will increment once, then the timer stops?
You need some conditional code. Maybe test whether incrementing the progress bar would overflow, and if so stop the timer and change the button state.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Hi,
10 milliseconds, yes that's what I meant, I wanted the progress bar to go up 1 every 10 milliseconds until it hit the maximum value then stop, btu the timer stop isn't working. The timer doesn't appear to stop, or I think the way I have the code, its won't stop as it trying to go one higher than the maximum value of the progress bar and not stopping when it gets to maximum value. I just was not sure where to put the timer stop code so that the timer would stop when progress bar gets to its maximum value, I think this way it will stop when it gets one over its maximum value, which it can't do.
In the end we're all just the same
|
|
|
|
|
Hello,
In a combobox when it's dropped down you can let the list scroll down by moving the mouse below the combo box. The problem is that this moves much too fast when the combo box is populated by a large number of items.
Is there a way to slow this scrolling ?
TIA
Rob
|
|
|
|
|
There is no property or method to do slow down the scrolling.
How many is "a large number of items"?? Putting a large number of items into a Combo is not a good idea. It makes finding items difficult for the user. Try limiting the number of items with filtering first.
|
|
|
|
|
Pity there's no way to slow down the scrolling, but thanks for your answer anyway, I don't have to search for the needle in the haystack anymore.
A large number of items is a couple of hundred, eg the items for sale in a company. I have created a filtering option but the user wants to see the total list at once.
Thanks for your time.
Rob
|
|
|
|
|
PosiRob wrote: A large number of items is a couple of hundred, eg the items for sale in a company
Yikes - talk about a nightmare to navigate through. This is where the customer has no idea what they're doing. He'll be screaming when he has a thousand items to sell and it takes too long to find each one to fill out an order.
Filtering by category is definitely the way to go. Though, you could still give the option to remove the filters and let him destroy the usability of his UI anyway.
|
|
|
|
|
Not sure if we are talking ASP, Windows or WPF but you can normally find an auto complete control which may provide a better solution.
"You get that on the big jobs."
|
|
|
|
|
Yes, I was going to suggest that. A dropedit combo with autocomplete would be the correct WPF/WinForms solution, in my opinion, and you can emulate that quite well on the web too (like the Gmail address picker).
|
|
|
|
|
I'm allways hungry for better solutions. What is a dropedit combo ?
By the way, I forgot to mention it is a windows forms solution.
Thanks,
Rob
|
|
|
|
|
Dropedit combo = combo you can also type into. In WinForms I think it is the default? (DropDownStyle = DropDown.) I don't believe there is an autocompleting one in the framework, but it's simple enough to catch TextChanged and update the list.
|
|
|
|
|
Don't over fill a combo box.
If you need to have a single selector, why not have it filter by alphanumeric input from the keyboard?
Alternatvely, increase the size of the dropdown, this will allow more room for 'whizz past' selections!
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
I have a custom user control ,in its OnPaint(), drawing some basic shapes like triangle, rectangle etc.
by using ClientRectangle's coordinates and size.
I want to rotate the control clockwise or counterclockwise with an angle,
but keeping the shape size unchanged. How?
Please help.
Thanks in advance.
Muharrem
|
|
|
|
|
You can make use of RotateTransform method in the Graphics class for this. Make sure you use e.Graphics from the Paint event handler and NOT create your own graphics object.
|
|
|
|
|
I have two datagridview controls showing a master/detail relationship, the master loads just fine, but the detail is not loading the relative records!
ps. The model was created using the designer, (ie. dragged from the database side pane)
Please help.
|
|
|
|
|
Hi
I am working on video conferencing system in c sharp vs2010 but facing difficulties, if some body has worked on it plz reply.
I need this for my project.
Thanx
modified on Friday, April 15, 2011 3:20 PM
|
|
|
|
|
Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know.
Edit your question and remove the email address.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
|
Let me get this straight. You want to know if anybody here has worked on the video conference system you are building?
This is not the age of reason, this is the age of flummery, and the day of the devious approach. Reason’s gone into the backrooms where it works to devise means by which people can be induced to emote in the desired direction.
|
|
|
|
|
yup.. if somebody has worked on this type of project then let me know its basics and available api's.
|
|
|
|
|
I doubt seriously that anyone here is going to hand over that much code without being paid for it. Google may be your friend.
However, if you try it yourself, and have a difficulty, I'm sure someone here can help you through it.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
This link[^] might help you.
you can also go there[^] having same problem with solutions.
|
|
|
|
|
how can convert image to webp format ?
|
|
|
|
|
Two choices. You're either going to have to write the whole image decoder yourself, or you can use the converter available here[^]. And before you ask, no I can't provide the code for you - you'd have to write it yourself.
|
|
|
|
|
You are really just no fun, Pete...
I wasn't, now I am, then I won't be anymore.
|
|
|
|