Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

If Value Has Changed

nethawknethawk Member Posts: 7
Hey guys, I need to know what code code to use. If a user selects a file, then changes the file to something else, I want to be able to tell if they have done this so I can display a message. Thanks.

Comments

  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444
    : Hey guys, I need to know what code code to use. If a user selects a
    : file, then changes the file to something else, I want to be able to
    : tell if they have done this so I can display a message. Thanks.
    :

    You mean when the user selects another file? That should be easy.

    If you mean when the selected file is changed (as in written to by another process for instance) than that's going to be more complicated.

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • nethawknethawk Member Posts: 7
    : : Hey guys, I need to know what code code to use. If a user selects a
    : : file, then changes the file to something else, I want to be able to
    : : tell if they have done this so I can display a message. Thanks.
    : :
    :
    : You mean when the user selects another file? That should be easy.
    :
    : If you mean when the selected file is changed (as in written to by
    : another process for instance) than that's going to be more
    : complicated.
    :
    : Best Regards,
    : Richard
    :
    : The way I see it... Well, it's all pretty blurry
    Yes, sorry I wasn't more descriptive. I have a program where the user selects a file using openfiledialog, then they select a folder using browsefolderdialog, then the user clicks a command button and a file with the source file name is created. But if they click cancel in the browsefolderdiaog the file name is still displayed in the text field (\hello.abc). I want this field to remain empty if the user clicks cancel and I want a command button to remain disabled until they select a folder. I wrote something like this but it would'nt work annywhere:

    If browsefolderdialog1.selectedpath is nothing then
    text1.text = ""
    command1.enabled = false.

    Please help!
  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444
    : Yes, sorry I wasn't more descriptive. I have a program where the
    : user selects a file using openfiledialog, then they select a folder
    : using browsefolderdialog, then the user clicks a command button and
    : a file with the source file name is created. But if they click
    : cancel in the browsefolderdiaog the file name is still displayed in
    : the text field (\hello.abc). I want this field to remain empty if
    : the user clicks cancel and I want a command button to remain
    : disabled until they select a folder. I wrote something like this
    : but it would'nt work annywhere:
    :

    Try to find a property named Cancelled (or something like that). It should specify whether or not the user cancelled the browsing. Else, try checking for = "" instead of Is Nothing.

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • nethawknethawk Member Posts: 7
    : : Yes, sorry I wasn't more descriptive. I have a program where the
    : : user selects a file using openfiledialog, then they select a folder
    : : using browsefolderdialog, then the user clicks a command button and
    : : a file with the source file name is created. But if they click
    : : cancel in the browsefolderdiaog the file name is still displayed in
    : : the text field (\hello.abc). I want this field to remain empty if
    : : the user clicks cancel and I want a command button to remain
    : : disabled until they select a folder. I wrote something like this
    : : but it would'nt work annywhere:
    : :
    :
    : Try to find a property named Cancelled (or something like that). It
    : should specify whether or not the user cancelled the browsing. Else,
    : try checking for = "" instead of Is Nothing.
    :
    : Best Regards,
    : Richard
    :
    : The way I see it... Well, it's all pretty blurry
    Solved it! I used the vbCancel thingy to detect whether or not the Browse dialog had been cancelled. then added text lookup to see wether the text feild was empty.

    If saveImage.ShowDialog = vbCancel And Text2.Text = "" Then
    createButton.Enabled = False
    Else...

    Sounds complicated, but my proggy works fantastic now.
Sign In or Register to comment.