Board index » cppbuilder » How to select next/prev component ???

How to select next/prev component ???

I need to select the next or the previous edit component on a form.
How i can do it?

Thanks

 

Re:How to select next/prev component ???


Note:
I not know what form have the focus

Re:How to select next/prev component ???


Quote
> I need to select the next or the previous edit component on a form.
> How i can do it

// The WM_NEXTDLGCTL message allows you to set the input focus to the
// next control in a window:

   SendMessage(Handle, WM_NEXTDLGCTL, 0, 0);

// where Handle is the handle of your form.  To determine which form
// is currently active, use the TScreen::ActiveForm property.

// To move to the previous control:
   SendMessage(Handle, WM_NEXTDLGCTL, 1, 0);

// --
// Yoto Yotov

Re:How to select next/prev component ???


Hi Paolo --

Quote
> I need to select the next or the previous edit component on a form.
> How i can do it?

You can use the TWinControl::SelectNext() function.  The GoForward parameter
controls the direction.

Good luck!

Damon C. (TeamB)

Other Threads