|
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
|
|
|
|
|
this is the standard address....
no : 5,abc building,xx street,yy city,country
but the user may give any in any order...my program should standadize it in the above format
abc building,no : 5,xx street,country,yy city
this is the input from the user
|
|
|
|
|
lawrenceinba wrote: the standard address
Local yes, but other countries may use different formats.
I are troll
|
|
|
|
|
One idea for you to think about:
if you have an address for example that consists of 4 data fields i.e
Street
City
Country
Postcode
you can assigned each value an index like
street = 0, city = 1, country = 2, postcode = 3
then you ask the user for there preffered order;
maybe they put street(0), city(1), postcode(3), country(2)
then when you load your address data which should always be stored in a standardised format you can load it in the order required based on the index values.
Sorry if this is not making to much sense, its a hard one to explain
do you get the idea?
|
|
|
|
|
an example:
string[] loadedAddress = {"Street", "City", "Country", "Postcode"};
int[] userFormat = {0, 1, 3, 2};
for(int i = 0; i < userFormat.length; i++)
{
textbox1.text += loadedAddress[userFormat[i]] + "\n";
}
|
|
|
|
|
There is no "standard" for postal addresses, or the postal service would use it. The postal-service will not comply to the standards that we design, so we (as developers) have to ensure that we can use any address (in any format) as provided.
E.g., there are three different formats of "normal" addresses in Holland. We got the usual street-zipcode combination, we got Postboxes for companies and we got Answeringnumbers - a sort of Postbox for a company, but without the need to stamp the damn thing.
The first one, street-zipcode combination, uses a number for the house. That's the most common way, I guess. Alas, Curacao has some streets where there aren't any numbers on the house - the postal-worker has to verify the address by reading the addressed family-name.
Unless you're going to use the address-details in computations/measurements/analysis, I'd suggest you be liberate in what you accept.
HTH
I are troll
|
|
|
|
|
actually its an artificial intelligence system.....
TRAIN HMM is a software used to train the standard address format and save the probability in a log file... from which it'll be useful to standardize using viterbi algorithm(source:wikipedia)
|
|
|
|
|
So you're going to develop something that can verify whether something 'could be' an address? Sounds cool and complex!
Good luck
I are troll
|
|
|
|