Results 1 to 13 of 13

Thread: A Smarter TextBox

Threaded View

  1. #7

    Thread Starter
    Hyperactive Member DavesChillaxin's Avatar
    Join Date
    Mar 2011
    Location
    WNY
    Posts
    451

    Re: *NEW* SmartTextBox

    Quote Originally Posted by JuggaloBrotha View Post
    Though this looks like a great start to an all-in-one textbox control, I do see a few things with it. If you're going to be handling currency you should probably make use of the globalization to determine if the input is valid for currency, rather than hard code $'s, or pound sign (£ or ₤) and so on.
    I had already considered this, but for my application I'm sticking with whats local. The program I initially made this for has no intentions of ever handling any currency types other than USD or any type that uses the $ sign. Small business' don't handle more than one type of currency at a time so to have that option would be a flop. Rather I could have another property set aside for when currency has been selected, you can then input the currency sign of your requirements(by default $ would be used)


    DavesChillaxin, one of the reasons a control like this isn't natively in the framework is probably because MS developed separate controls for these types of things, really the only thing that your control does that none of the current MS ones do is the watermark. For numeric only input there's the NumericUpDown control, for standard text box there's the TextBox & for anything that needs to be specially formatted (like currency or a phone number, or SSN, etc) there's the MaskedTextBox where you set the input mask to what you need. Separate controls for specific needs instead of 1 control for most (or all) needs.
    I feel if a company has passwords, such as PINS - then a numericupdown would definitely not be the control to use. So still I would have to create a textbox, and then code under it's respectable events to restrict all characters but numbers. This is a lot more work to do when all I would have to do is add my modified textbox and select it's input type to numeric only. Same for currency and phone input fields. I have multiples of them, and I don't want to have to code them all. My application is a business management and inventory system. I have multiple forms with specific input fields. I'm not about to code every single one of those textboxes when I can add mine, and select a property to specify it's input types.


    Also the decimal point. I have my modified textbox restricting only one to be passed when the input type involve numerics. To have more than one would always cause problems unless dealing with IPs-which I feel like adding as a specific input type.


    So really I'm just controlling the input of characters. I'm not formatting the text to any specific format types. Just restricting specific characters according to what the developers use for that textbox might be. Solves the problem at the source.
    Last edited by DavesChillaxin; Jan 26th, 2012 at 01:43 PM.
    Please rate if my post was helpful!
    Per favore e grazie!




    Code Bank:
    Advanced Algebra Class *Update | True Gradient Label Control *Dev | A Smarter TextBox *Update | Register Global HotKey *Update
    Media Library Beta *Dev | Mouse Tracker (Available in VB.net and C#.net) *New | On-Screen Numpad (VB.net) *New

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width