How to create a control to do this?...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jason

    #1

    How to create a control to do this?...

    I would like to create a control to do something like this:

    accept a numeric value (>0 and <=3899) in the textbox, convert it to a
    Roman Numeral and display it in a label. Write functions called from
    the Leave event of the textbox to validate the entry in the textbox and
    convert it to Roman.
    The entry of an invalid value in the textbox should result in the entry
    going away, the textbox becoming yellow and getting focus. Valid
    entries should turn the textbox green and the control itself medium
    seagreen and display the Roman Numeral in the label.

    anyone have any ideas how this would be done?

  • Cerebrus

    #2
    Re: How to create a control to do this?...

    Hi Jason,

    I did something similar a while back, though I didn't create a
    UserControl to do it.I just created a RomanConverter Class library.
    [color=blue][color=green]
    >> anyone have any ideas how this would be done?[/color][/color]

    1. Create a Class that converts integers to Roman numerals. You can
    find an excellent example at
    "http://www.vb-helper.com/howto_roman_ara bic.html". There are lots of
    other samples on the web, many in VB. Another one is :
    "http://www.thevbprogra mmer.com/Ch08/08-10-RomanNumerals.h tm"

    2. Create your UserControl, referencing the above class, and adding all
    validation code as necessary. I assume you are familiar with the
    nuances of User control creation.

    3. Compile your code and add that control to a Windows form to test it
    out.

    Note that Roman numbers are normally considered upto 3999 and not 3899.

    Hope this helps,

    Regards,

    Cerebrus.

    Comment

    • Cor Ligthert [MVP]

      #3
      Re: How to create a control to do this?...

      "Cerebrus" ...

      Nice pages,

      I have copied the links

      Cor


      Comment

      • Cerebrus

        #4
        Re: How to create a control to do this?...

        LOL, Hi Cor,

        That's nice to hear, but whatever do *you* need the links for ?

        Regards,

        Cerebrus.

        Comment

        • Cor Ligthert [MVP]

          #5
          Re: How to create a control to do this?...

          Cerebrus,

          When there comes again chalenges to create this smaller to have the samples.

          This is are nice things to do just for fun to make it as short as possible.

          We did this already once in a kind of way in this newsgroup with Roman
          (Latin) to (west) Arabian.

          Cor

          "Cerebrus" <zorg007@sify.c om> schreef in bericht
          news:1142933225 .144374.173170@ i40g2000cwc.goo glegroups.com.. .[color=blue]
          > LOL, Hi Cor,
          >
          > That's nice to hear, but whatever do *you* need the links for ?
          >
          > Regards,
          >
          > Cerebrus.
          >[/color]


          Comment

          Working...