Results 1 to 6 of 6

Thread: Reloading a form with that form (resolved)

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    683

    Reloading a form with that form (resolved)

    I have a single form app. It is used for inventory with a barcode scanner. Afer every scan, a new textbox is generated and the focus is moved to that textbox. Once done scanning the room, the user saves the data and it is written to a textfile. I would like that app at this point to basically clear the form and be ready for the next room. Because it generates the textboxs at runtime, I cannot just have it clear all the textboxs to "" because the majority of them need to be removed. Right now the user, closes the app and restarts it, not too efficient. Is there a way to have the form unload and reload when you are clicking a button on that same form or is there another way to accomplish this?
    Last edited by Beast777; Apr 18th, 2005 at 10:05 AM.

  2. #2
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: Reloading a form with that form

    Quote Originally Posted by Beast777
    I have a single form app. It is used for inventory with a barcode scanner. Afer every scan, a new textbox is generated and the focus is moved to that textbox. Once done scanning the room, the user saves the data and it is written to a textfile. I would like that app at this point to basically clear the form and be ready for the next room. Because it generates the textboxs at runtime, I cannot just have it clear all the textboxs to "" because the majority of them need to be removed. Right now the user, closes the app and restarts it, not too efficient. Is there a way to have the form unload and reload when you are clicking a button on that same form or is there another way to accomplish this?

    Generating loads of textboxes is inefficient. It would be much better to use something like a listView to store the data. Then you could save the data more easily and reset the list without problems. You wouldn't need to restart the form at all.
    I don't live here any more.

  3. #3
    Member Retali8's Avatar
    Join Date
    Mar 2005
    Location
    Toronto
    Posts
    49

    Re: Reloading a form with that form

    Ya the listview would be alot better for you for this.
    for 1 its really easy to do and keeps everything nicely organized.

  4. #4
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Reloading a form with that form

    Another option would be to pre-create all the textboxes (rather than making them at runtime) and simply toggle their visibility. If the number of boxes is few enough that the form looks good with them all there, then this is a viable option. Clearing the form becomes easier with this solution, as well. If there are more textboxes than that, the Cat o' thousand names is right.
    My usual boring signature: Nothing

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    683

    Re: Reloading a form with that form

    They have to be created at runtime because each room that is scanned is different and some of the rooms, for example the storage room, can contain thousands of items.

  6. #6
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Reloading a form with that form

    In that case, not only would a listview work better for you, it would make more conceptual sense, as well.
    My usual boring signature: Nothing

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