Announcement

Collapse
No announcement yet.

delete in edit menu, select all text

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Rodney Hicks
    replied
    Michael, I am not and was not expecting you to experience the epiphany!
    I concur fully with you.

    Leave a comment:


  • Michael Mattias
    replied
    >He has posted the code in one of the many other forum threads dealing with his issues

    IMO one should not ask others to "search" - and in this case, "guess which one" as the first step in helping you.

    Besides, if this line is not working, it's not the same code, is it? And I do believe we've all seen one or two times A "problem line" was not THE REAL "problem line."

    MCM

    Leave a comment:


  • Rodney Hicks
    replied
    >What next?

    What's next is learning how much and how to post the code which is giving you trouble.
    Reply With Quote
    He has posted the code in one of the many other forum threads dealing with his issues. An epiphany is in order, though.

    Leave a comment:


  • Rodney Hicks
    replied
    Try it this way:
    Code:
    CASE %IDM_EDIT_DELETE
       ' Control Set Text hDlg, %IDM_EDIT_DELETE, ""   
       CONTROL SET TEXT CB.HNDL, %IDC_USERENTRY, ""
       CONTROL REDRAW CB.HNDL, %IDC_USERENTRY
    The REDRAW forces the change now, rather than letting it wait in the queue.
    Notice the use of the CB.HNDL instead of hDlg in the CALLBACK FUNCTION.

    Leave a comment:


  • Fred Buffington
    replied
    How about
    Code:
    LOCAL Clearit$=""
    CONTROL SET TEXT hDlg,Control_ID%,Clearit$
    where hDlg is the dialog handle and Control_ID% is the handle of the control within the dialog.

    This will work for textbox and Static controls (Label).

    Leave a comment:


  • Michael Mattias
    replied
    >What next?

    What's next is learning how much and how to post the code which is giving you trouble.

    Leave a comment:


  • Brian Heibert
    replied
    delete didn't work

    I tried to do this to do delete

    CASE %IDM_EDIT_DELETE
    ' Control Set Text hDlg, %IDM_EDIT_DELETE, ""
    CONTROL SEND hDlg,%IDC_USERENTRY, %EM_SETSEL, 0, -1

    But nothing happened no deletion

    What next?

    Brian

    Leave a comment:


  • Michael Mattias
    replied
    ....OR (for those of us who cannot remember which parameters are used with which messages.. or how to spell all those messages )......

    Code:
    #IF %DEF(%USING_DDT)
       MACRO Edit_SelectAll (hWnd, idctrl) = CONTROL SEND hWwd, idctrl, %EM_SETSEL, 0, -1&
    #ELSE
      MACRO Edit_SelectAll (hWnd, idctrl) = SendDlgItemMessage hWnd, idctrl, %EM_SETSEL, 0, -1&
    #ENDIF
    
    
    ....
    CALLBACK FUNCTION ....
           
            Edit_Selectall (CB.HNDL, %ID_MY_TEXTBOX)
    MCM

    Leave a comment:


  • Adam J. Drake
    replied
    Windows provides messages for easily duplicating functionality in an edit field context menu:

    MSDN: WM_UNDO
    MSDN: WM_CUT
    MSDN: WM_COPY
    MSDN: WM_PASTE
    MSDN: WM_CLEAR (delete)
    MSDN: EM_SETSEL

    EM_SETSEL can be used in this form to duplicate Select All functionality:

    Code:
    SendMessage hWnd, %EM_SETSEL, 0, -1
    or

    Code:
    CONTROL SEND hDlg, CtrlID, %EM_SETSEL, 0, -1

    Leave a comment:


  • Michael Mattias
    replied
    The EM_SETSEL message allows you to set the selection text in an edit control; the EM_REPLACESEL message allows you replace that selection with anything, or with nothing (delete it).

    MCM

    Leave a comment:


  • Rodney Hicks
    replied
    Really Brian, showing your full code, preferably in compilable form would get you a lot more help that wouldn't leave you asking so many questions. Reading the manual and checking the files in the Examples or Samples folder that came with your compiler would save you time.
    Because some of your questions are to some quite elementary, we aren't sure that you are asking the right question.
    In this latest question of yours, an ID with %IDM_etc is usually a Menu ID and as such "CONTROL SET TEXT" does not apply to it.

    There is a very good Menu example in the Help file, just click on M from the home page of the HELP, select a MENU item and at the bottom of it, it will show "EXAMPLE See Menu Example".

    Leave a comment:


  • Brian Heibert
    replied
    I tried to use this
    CONTROL SET TEXT hDlg, %IDM_EDIT_DELETE, ""

    However it isn't working it doesn't delete the text in the edit field

    Leave a comment:


  • Gary Beene
    replied
    Brian,
    In the other example I gave you , with the Select/Unselect text, at:

    http://www.garybeene.com/power/code/..._gbs_00139.htm

    If you want to remove the text in an edit control, then all you need is to use this line for the response code for one of the buttons.

    Code:
    Control Set Text hDlg, %ID_Text, ""

    Leave a comment:


  • Brian Heibert
    started a topic delete in edit menu, select all text

    delete in edit menu, select all text

    How do I do the delete function in the edit menu?
    Sometimes called Delete other times called Clear?

    Also how do I select all text in my edit field

    Brian
Working...
X