Results 1 to 3 of 3

Thread: [2005] Input Box Help Please

  1. #1

    Thread Starter
    Hyperactive Member Jonny1409's Avatar
    Join Date
    Mar 2005
    Posts
    308

    [2005] Input Box Help Please

    Hello,

    I wonder if anyone can help me please ?

    I have an inputbox which is used to enter a date, then do stuff based on the date chosen.

    The application automatically populates the input box for the user, and they can then change it if required.

    My code is :
    Code:
    Dim DateFrom As String = String.Empty
    DateFrom = InputBox("Please Enter the Date you wish to Export From", "Date From", "01/" & Month(CalendarView1.CalendarDate) & "/" & Year(CalendarView1.CalendarDate))
    However I get a problem if someone presses cancel in as much as it still tries to run the routine based on the date the box was defaulted to.

    How can I capture that they have pressed cancel and cancel the operation accordingly ?

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: [2005] Input Box Help Please

    The inputbox returns an empty string if the user presses cancel.
    Altough, I would strongly encourage you to create a form that mimics the inputbox functionallity, as that will defenitly provide more functionallity.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3

    Thread Starter
    Hyperactive Member Jonny1409's Avatar
    Join Date
    Mar 2005
    Posts
    308

    Re: [2005] Input Box Help Please

    Thanks Athiest - I must admit I did toy with the idea of creating a form for the purpose.

    I think that's what I'll do.

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