CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2004
    Posts
    105

    Find Functionality in Notepad

    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

  2. #2
    Join Date
    Mar 2004
    Posts
    223

    Re: Find Functionality in Notepad

    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.

    [If you find my answers useful, please leave your comments and rating for it.]
    Happy Coding!
    My Dev.: MS VS 2005 Version 8.0.50727.42 .NET 2.0.50727
    Mark your answers Tools>>RESOLVED once its answered.

  3. #3
    Join Date
    Nov 2004
    Posts
    105

    Re: Find Functionality in Notepad

    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

  4. #4
    Join Date
    Mar 2004
    Posts
    223

    Re: Find Functionality in Notepad

    Quote Originally Posted by battula32
    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.

    [If you find my answers useful, please leave your comments and rating for it.]
    Happy Coding!
    My Dev.: MS VS 2005 Version 8.0.50727.42 .NET 2.0.50727
    Mark your answers Tools>>RESOLVED once its answered.

  5. #5
    Join Date
    Mar 2004
    Posts
    223

    Re: Find Functionality in Notepad

    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.

    [If you find my answers useful, please leave your comments and rating for it.]
    Happy Coding!
    My Dev.: MS VS 2005 Version 8.0.50727.42 .NET 2.0.50727
    Mark your answers Tools>>RESOLVED once its answered.

  6. #6
    Join Date
    Nov 2004
    Posts
    105

    Re: Find Functionality in Notepad

    Thanks Charu

    I will use SetForegroundWindow(...)

    Thanks and Regards
    Ravi.Battula

  7. #7
    Join Date
    Mar 2004
    Posts
    223

    Re: Find Functionality in Notepad

    Sure you're welcome.

    [If you find my answers useful, please leave your comments and rating for it.]
    Happy Coding!
    My Dev.: MS VS 2005 Version 8.0.50727.42 .NET 2.0.50727
    Mark your answers Tools>>RESOLVED once its answered.

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

Featured