![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Programmer
Join Date: Sep 2007
Posts: 33
Rep Power: 0
![]() |
Re: Arraylist ideas
Really, Thanks again. I was close, but there always is that finishing touch that you forget.. Thanks
Now I am going to work on a printing function.. Is there any good sites for creating a printing onto a template? I found this http://www.devarticles.com/c/a/C-Sha...Using-C-sharp/ so hopefully it helps..
__________________
Slowly but surly trying to learn C#, SQL, VB.Net, and wondering if a tornado crosses the equator if it spins backwards.... |
|
|
|
|
|
#12 |
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,005
Rep Power: 5
![]() |
Re: Arraylist ideas
I'd use
long.TryParse() for checking the input for validity. Exception handling seems to be overkill for something like this. You'd get something that's similar to this: c# Syntax (Toggle Plain Text)
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot. - Vaarsuvius, Order of the Stick |
|
|
|
|
|
#13 |
|
Newbie
Join Date: Oct 2007
Posts: 29
Rep Power: 0
![]() |
Re: Arraylist ideas
Personally I would keep the handling in a different area in order to not cause uncomfortability to the user.
By making the textbox(es) only accept numeric characters, which I presume you are already doing, and validating the input as entered it can easily be acheived as such: private void textBox_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsDigit(e.KeyChar)) { }
else if (e.KeyChar == '\b') { }
else { e.Handled = true; }
}
private void textBox_TextChanged(object sender, EventArgs e)
{
long value;
if (!long.TryParse(textBox.Text, out value))
textBox.Text = long.MaxValue.ToString();
} |
|
|
|
|
|
#14 |
|
Programmer
Join Date: Sep 2007
Posts: 33
Rep Power: 0
![]() |
Re: Arraylist ideas
Well yea.. I want to make sure they dont input
1.) Any more that 9 digits... 2.) No letters 3.) Nothing difference in numbers over 5,000 GOOD ex. (start)3216510001 - (end)321651501 BAD ex. (start)3216510001 - (end)321659009 Just to eliminate errors...
__________________
Slowly but surly trying to learn C#, SQL, VB.Net, and wondering if a tornado crosses the equator if it spins backwards.... |
|
|
|
|
|
#15 | |||
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,005
Rep Power: 5
![]() |
Re: Arraylist ideas
Quote:
Quote:
Quote:
c# Syntax (Toggle Plain Text)
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot. - Vaarsuvius, Order of the Stick |
|||
|
|
|
|
|
#16 |
|
Newbie
Join Date: Oct 2007
Posts: 29
Rep Power: 0
![]() |
Re: Arraylist ideas
I thought my post made a pretty clear example of what you go on to explain lectric, my apologies if it was not concise enough.
Textbox controls can also be configured so that copying/pasting is not possible, creating a custom control seems a bit OTT as you say, lectric, but disabling context menus etc is alot easier. But here's an idea, the NumericUpDown control may be best suited. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ArrayList Start Index | kruptof | C# | 8 | Sep 2nd, 2007 10:20 AM |
| Problem with an ArrayList | Twilight | C# | 2 | Apr 25th, 2006 1:15 PM |
| ArrayList and MSDN | Writlaus | C++ | 13 | Apr 5th, 2006 3:27 AM |
| ArrayList Troubles | crawforddavid2006 | Java | 17 | Jan 10th, 2006 6:37 PM |
| Converting object to arraylist | yusufozkay | C# | 1 | Jul 18th, 2005 8:08 AM |