Urgent problem with forms and dialogs

  • Thread starter Juan Pedro Gonzalez
  • Start date
J

Juan Pedro Gonzalez

Helo again,

I've got a small problem with an application. My application is basically a
listView, and when I click on an item another form pops up (At the moment
it's called through ShowDialog with no OK or X button). The new form must be
disposed through several options on the menu (Cancel, Save and exit,...).
I've tried closing the form and dispossing the form, but whatever I do the
first form (From wich I called the dialog) won't show up. I've made a small
walk around by declaring a public property in wich I save the caller form,
then on the onClose Event of the dialog form I try to Show and then
Bringtofront the caller form. This works perfectly at first, but it has one
drawback: it seems a have to tap once on the screen so I can use it again.
For example, before selecting an item in the listview I have to tap on the
screen, and the select the item from the listview. This gives an awfull look
to the application, and I guess there must be another way to do it neater.

How could I disspose the form in a clen manner? That is, how could I
disposse the form so the caller form will be shown and I don't have to tap
on the screen before I can use a control on it?

Best wishes
 
P

Peter Foot [MVP]

It sounds like the initial tap is required to return focus to the listview.
One technique which should work is to handle the Activated event on your
main form, and set focus to the listview. This way your listview will
receive focus whenever your main dialog is shown.

Peter
 
J

Juan Pedro Gonzalez

I've tried to do it that way but it gives out the same result... By the way,
it doesn't only affect the Listview, it will affect any control on the form,
including menus, buttons, etc... After the single tap on the string the
menus, listview, buttons will work on a single tap. I've tried refreshing
the form, setting focus to the form and its controls, refreshing controls,
.... but the single tap seems to be required what ever I do.

I'm running mad trying to dispose a form and getting back to the one that
launched it (without having to do the single tap on screen).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top