Jump to content

how to load new data into calling form when the called form is closed

- - - - -

  • Please log in to reply
3 replies to this topic

#1
yukou

yukou

    Newbie

  • Members
  • Pip
  • 3 posts
how can i load new data into calling form when the called form is closed

for example

I have 2 form:

form A and form B

form A has combobox (which has listitems "Paris", "Rome", "Madrid" =>the listitem comes from database )

form A calls form B (show dialog)

In form B, i add new city for example "London"

when i close form B, i want combobox in form A to load city data again

(now, the list contains "Paris", "Rome", "Madrid", "London")

How can i deal with this problem?

*sorry if my english isn't well

thanks :)

#2
Momerath

Momerath

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 243 posts
Don't close the form (which unloads it) but Hide it instead. Then you can get whatever data you want, then close the form.

#3
elloco999

elloco999

    Newbie

  • Members
  • Pip
  • 3 posts
Do you add the new value (London) to the database in form B? If so, you can reload the combobox in form A when form A regains focus (OnFocus event).

#4
yukou

yukou

    Newbie

  • Members
  • Pip
  • 3 posts
thanks for the answers mate
but i had found the answers

Just share what i'd found

-make a public function to get value from form B -->for example public function gettingvalue()
-pass object form A to form B
-override form B 's constructor
-make object form A in form B
- call gettingvalue() when form B is closed




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users