Click to See Complete Forum and Search --> : Find Functionality in Notepad


battula32
March 8th, 2007, 02:18 AM
Hi All,

I am working on flexgid, Here I need to find some of the strings populating in flexgrid. I designed find dialog layout just like Notepad find dialogbox.

But I didn't get the total functionality of notepad find window.
I am calling Find form as

frmFind.ShowDialog();

If I call like it will open like model dialog and I can not able to select the background( Flexgrid form) unless until I close this find dialog box, But i case of notepad we can able to select background notepad window also.

Can anybody help on this how they acived this functionality, How they are calling the find window?. Is it model dialog box or not?

regards
Ravi.Battula

Charu0306
March 8th, 2007, 02:55 AM
When a modal dialog is shown, it requires that no other window receives input focus for that application. So, in Notepad, guess its modalless dialog only. Find dialogs are implemented as non-modal only usually.

Keep it non-modal and only then you can select line in Flexgrid. :)

battula32
March 8th, 2007, 04:17 AM
If I call it as non-modal dialog, If I select the flexgrid, then Find window is going behind the Flexgrid form(Main window).

But in case of notepad after selecting notepade text also, find window will appear upon notepad window, only it loses focus, still it stays on top of notepad (main window). I want know how they are handling this.

regards
Ravi

Charu0306
March 9th, 2007, 12:24 AM
If I call it as non-modal dialog, If I select the flexgrid, then Find window is going behind the Flexgrid form(Main window).

But in case of notepad after selecting notepade text also, find window will appear upon notepad window, only it loses focus, still it stays on top of notepad (main window). I want know how they are handling this.

regards
Ravi

Try to set MessaegBoxStyle as SetForegroundwindow . It should work here.

Charu0306
March 9th, 2007, 12:25 AM
Actually, you can use the Datagrid's datasource Find method and then pass the Text typed by the user to search for that column value as a parameter to Find and select. If a record is found, you can highlight it then. :)

Try to do it. :)

battula32
March 9th, 2007, 03:46 AM
Thanks Charu

I will use SetForegroundWindow(...)

Thanks and Regards
Ravi.Battula

Charu0306
March 9th, 2007, 04:32 AM
Sure you're welcome. :)