Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. MonthCalendar problem

MonthCalendar problem

Scheduled Pinned Locked Moved C#
helpquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gavin Jeffrey
    wrote on last edited by
    #1

    Hi, I have a readonly textBox on my windows form, when the user clicks on the textBox I display a monthCalendar control, then in the DateSelected event I populate the textBox with the selected date. My only problem is that the user might decide that the date is not necessary and want to remove it from the textBox. I have tried looking at the hitTest method of the calendarControl but the hitTestArea is always returned as nowhere. Does anyone have any idea of how I might be able to remove the date from the textBox?? Thanks in advance. Gavin Jeffrey

    N S 2 Replies Last reply
    0
    • G Gavin Jeffrey

      Hi, I have a readonly textBox on my windows form, when the user clicks on the textBox I display a monthCalendar control, then in the DateSelected event I populate the textBox with the selected date. My only problem is that the user might decide that the date is not necessary and want to remove it from the textBox. I have tried looking at the hitTest method of the calendarControl but the hitTestArea is always returned as nowhere. Does anyone have any idea of how I might be able to remove the date from the textBox?? Thanks in advance. Gavin Jeffrey

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      This is really just a UI design issue, you could simply add a small button with a Text property of "Clear" which would then clear the value from the TextBox. - Nick Parker
      My Blog | My Articles

      1 Reply Last reply
      0
      • G Gavin Jeffrey

        Hi, I have a readonly textBox on my windows form, when the user clicks on the textBox I display a monthCalendar control, then in the DateSelected event I populate the textBox with the selected date. My only problem is that the user might decide that the date is not necessary and want to remove it from the textBox. I have tried looking at the hitTest method of the calendarControl but the hitTestArea is always returned as nowhere. Does anyone have any idea of how I might be able to remove the date from the textBox?? Thanks in advance. Gavin Jeffrey

        S Offline
        S Offline
        Stefan Troschuetz
        wrote on last edited by
        #3

        How about a Button "Clear Date" or something similar besides your TextBox whose Click event handler simply clears the Text property of your TextBox.?


        www.troschuetz.de

        N 1 Reply Last reply
        0
        • S Stefan Troschuetz

          How about a Button "Clear Date" or something similar besides your TextBox whose Click event handler simply clears the Text property of your TextBox.?


          www.troschuetz.de

          N Offline
          N Offline
          Nick Parker
          wrote on last edited by
          #4

          We apparently posted at the same time, however I must have beaten you by mere seconds. ;) - Nick Parker
          My Blog | My Articles

          S 1 Reply Last reply
          0
          • N Nick Parker

            We apparently posted at the same time, however I must have beaten you by mere seconds. ;) - Nick Parker
            My Blog | My Articles

            S Offline
            S Offline
            Stefan Troschuetz
            wrote on last edited by
            #5

            Yeah, it seems you won by a narrow margin. Congratulations :-D


            www.troschuetz.de

            G 1 Reply Last reply
            0
            • S Stefan Troschuetz

              Yeah, it seems you won by a narrow margin. Congratulations :-D


              www.troschuetz.de

              G Offline
              G Offline
              Gavin Jeffrey
              wrote on last edited by
              #6

              Thanks guys, Well this seems to be my only option - I was hoping to find a "cleaner" solution since my form is already so cluttered. I have searched endlessly but i can't seem to find any other way besides a button. Looks like i will have to go with the button. Thank for the help. Gavin

              S 1 Reply Last reply
              0
              • G Gavin Jeffrey

                Thanks guys, Well this seems to be my only option - I was hoping to find a "cleaner" solution since my form is already so cluttered. I have searched endlessly but i can't seem to find any other way besides a button. Looks like i will have to go with the button. Thank for the help. Gavin

                S Offline
                S Offline
                Stefan Troschuetz
                wrote on last edited by
                #7

                Another option that comes to mind is using a ContextMenu. For example this could be displayed after right-clicking your TextBox and contain the MenuItem "Clear Date". After clicking the MenuItem the TextBox is cleared. Never you really worked with ContextMenus so I can give no further help. But I think it's worth a try and shouldn't be that complicated:)


                www.troschuetz.de

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups