|
Did you set doublebuffering on?
"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 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Yes i have set it for both the main form hosting the panel and for the usercontrols.
There is no noticible difference between having double buffering on or off.
I have left it set to be on.
|
|
|
|
|
Here's a usability hint - scrolling controls on a form is a *bad* thing (in terms of usability). My advice is to either create a wizard form, or implement tabs.
"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 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I appriciate that and if the controls where different then i would take a different approach. In fact i have many tabs in parts of the application, in addition to one form which work like a wizard
But the controls in question are all instances of the same type, and they are used as a list of entries. Similar to having a list box or a datagridview with a number of rows.
The reason the usercontrol was created is to display the information in a custom layout with colors and buttons to match the general style of the application.
So im afraid having a scrolling panel is a must have. Esp considering just one control may be larger than the panel, as the usercontrol can grow based on content.
|
|
|
|
|
How many controls are you talking about scrolling?? If it's a larger number of controls, there's nothing you can do about it. Controls are just very expensive to create and paint.
|
|
|
|
|
well the issue occurs with less then 10 controls but there could potentially be alot more.
Does anybody have a suggestion for setting the scroll position on scroll drag?
I would like to be able to drag the scroll bar in increments of 50 pixels for instance
|
|
|
|
|
Without seeing your implementation, I feel compelled to call the design "crap". I've been coding for Window since Windows 3.0 was a "good idea", and I've NEVER ONCE had to implement a scrolling form, with the exception of a mobile application (using C++/MFC), and even that was eventually scrapped in favor of a wizard-type form.
"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 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
have you never used a dataGridView then?
if you want many rows of data they wont always fit on the screen.
hence why controls like dataGridView have scroll bars
what happens if one of your users minimises the application to be smaller then the page with your controls on?
|
|
|
|
|
musefan wrote: what happens if one of your users minimises the application to be smaller then the page with your controls on?
The simple answer is, you don't let them. Forms can have a minimum fixed size, preventing them from shrinking smaller than the minimum size required by their content. Figure out what the smallest possible size is that will fit for the greatest majority of your users, and fix that as your minimum.
|
|
|
|
|
Dont get me wrong i dont want to seem argumentative with this issue as i really do appreciate the feedback from everyone.
One issue as i have said is that even one control can grow to be bigger than the panel, whatever the panel size (which itself has to fit within the users screen).
The controls i am using are not disimilar to those of a forum, where a number of replys are listed on a page. and there size grows as needed to fit the content of the message etc.
If i copy and paste this message a few times, chances are it wont all fit on your screen. hence the scroll bar to show all.
you see this used in many application. for instance a word document will not all fit on screen at once if the content is large enough. You cant just cut the content when it fills the screen and expect to put the rest on another part of the application.
Now i appreciate that certain progroms such as web browsers are made to handle this kind of thing and are therefore optimised for the task, but you cant say that scroll bars should never be used cause some cases require that kind of functionality. (This paragraph would not even be here if the text box i am typing in didnt scroll)
|
|
|
|
|
Hi all,
I want to execute and exe, basically a process. Everything is fine. But I want to know what's the best way to handle this. Let me explain.
Say I start the process on a click event, but the button is not disable. So a user can click on it again. At that point I want to check that process is already running. If it's running I don't want to run it again.
What I have done here is, use a global variable and once the process is started make it to true. Once a user click that button, simply validate that variable. Is that a good practice?
Thanks
I appreciate your help all the time...
CodingLover
|
|
|
|
|
I would disable the button on starting the process and enable it back when the process is done working.
Like this:
private void button1_Click_1(object sender, EventArgs e) {
button1.Enabled = false;
Process proc = new Process();
proc.StartInfo.FileName = "notepad.exe";
proc.EnableRaisingEvents = true;
proc.Exited += new EventHandler(proc_Exited);
proc.Start();
}
void proc_Exited(object sender, EventArgs e) {
button1.Enabled = true;
}
Regards,
Lev
|
|
|
|
|
But the reason is I cannot disable the button. On that single click event I want to start two process. One of it is continuously running, that's what I want to check in this case. Other process can be start/stop randomly.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Well, if you cannot disable the button, then, I guess, you should go for what Giorgi has suggested
Regards,
Lev
|
|
|
|
|
Well, the behavior of this button is rather confused for user. Sometimes, refactor the design would be better choice.
I Love KongFu~
|
|
|
|
|
|
I have a class that I call Runner. It starts the required process, and then starts a background worker object that serves to allow the programmer to terminate the process. When the process terminates (either normally or by user-intervention, it fires a custom event and the calling form handles the event.
Using a class like this, you could disable the button when the process is started, and re-enable it when the process terminates. Alternatively, you could leave the button enabled and check to see if a globally-defined runner object is != null to see if you should display a message to the user or not.
I originally wrote this code so that I could track how much time was spent running the spawned process.
"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 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks for the comment.
Ya, that's the way I'm normally working on. But the thing here is I cannot disable the button. As I said in earlier post, in that click event I have to start two process.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Would you like me to post the code for you?
"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 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hello, Here is the code
private void button3_Click(object sender, EventArgs e)
{
button3.Enabled = false; Process proc = new Process(); proc.StartInfo.FileName = "notepad.exe"; proc.EnableRaisingEvents = true; proc.Exited += new EventHandler(proc_Exited); proc.Start();
}
void proc_Exited(object sender, EventArgs e)
{
myDelgate d = new myDelgate(enableBtn);
this.Invoke(d);
}
void enableBtn()
{
button3.Enabled = true;
}
Remember u should add the statement
public delegate void myDelgate();
inside the class which declare a delegate
I hav sucessfully disable the button on starting notepad and enable afte exiting the notepad
hope this code will help you.
|
|
|
|
|
hi friends anyone got idea for standardizing the input address into standand format which will be configued by the developer
preferred language is c#
|
|
|
|
|
Get each section of the address seperately from user and use string.Format(...) to do your thing.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
What do you mean by "address"? Do you mean a postal-location, or a mailaddress or something?
I are troll
|
|
|
|
|
ya it refers postal ADDRESS
do u have any idea
|
|
|
|
|
In which case it all depends on the country - there are multiple different formats for addresses. Pick one you like and use it
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|