mfc >> How to get to know the edit control's content has been modified on a dlg?

by Marco » Mon, 01 Dec 2003 09:50:25 GMT

How to get to know the edit control's content has been modified on a dlg?




mfc >> How to get to know the edit control's content has been modified on a dlg?

by David A. Mair » Mon, 01 Dec 2003 10:14:48 GMT






The parent of the edit control (the dialog box) should receive a EN_CHANGE
notification. You should have a ON_EN_CHANGE() entry in the message map for
the dialog with the edit's control ID as the first argument and the dialog
class member function that will service the EN_CHANGE notification. The IDE
should create most of these pieces for you leaving you to just provide the
implementation. In VS2003.NET select the Dialog class in the class view.
In the properties pane press the Events button (the lightning bolt). Open
the event list for the edit control's ID, put the cursor in the empty right
column next to the EN_CHANGE event, drop the list and select the Add
OnEnChange member.





mfc >> How to get to know the edit control's content has been modified on a dlg?

by Jeff Partch [MVP] » Mon, 01 Dec 2003 10:19:01 GMT





Try calling its GetModify member function or doing a
SendMessage/EM_GETMODIFY directly.
--
Jeff Partch [VC++ MVP]




How to get to know the edit control's content has been modified on a dlg?

by Marco » Mon, 01 Dec 2003 11:18:51 GMT

Thanks!
"David A. Mair" < XXXX@XXXXX.COM >



dlg?
for
IDE
right




How to get to know the edit control's content has been modified on a dlg?

by Marco » Mon, 01 Dec 2003 11:18:56 GMT

Thanks!
"Jeff Partch [MVP]" < XXXX@XXXXX.COM >



dlg?




Similar Threads

1. passing CListBox contents dlg-to-dlg

Hi,

I've been searching around and can't find any discussion on this particular 
issue:

I have multiple dialogs with "next" and "back" buttons. On one of the 
dialogs I have 3 listboxs that the user is able to enter multiple items, 
for example, names. Since I want to allow the user the ability to go back 
to the previous dialog (should they wish to change anything) I have been 
trying to pass the listbox info from dialog to dialog. However, I haven't 
figured out a good way to do this. I have tried to create a CListBox for 
each of the lists that I have and to put a listbox on each page (hidden for 
those dialogs that don't have that particular entry). However, I keep 
getting an ASSERT failure when I try to do the AddString for the listbox 
content that I'm passing. Here is an example:
 
// some temp variables
 char temp[MAXSTR];
 int i;
 
// COPY NAMES LIST VALUES
 
// Here I'm trying to copy the m_listNames list that I got from the user 
// on the CURRENT dialog, into the m_listNamesin list that I have defined
// on the previous dialog to save the content, so that I can restore it to
// this dialog when the user clicks NEXT and comes back to this one. 

 memset(temp, 0, sizeof(temp));
 prevDlg.m_listNamesin.ResetContent();
 for (configPersonalFilter::m_listNames.GetText(i=0, temp); 
   strcmp(temp,"") || i >= MAXURL;   
   configPersonalFilter::m_listNames.GetText(++i, temp))
 {
  // When I do the AddString, I get the Assert failure:
  prevDlg.m_listNamesin.AddString(temp);
  strcpy(temp, "");
 } // end for 

 
Any help/sample-code would be greatly appreciated! :-)
 
Thanks,
Glenn

2. Modeless Dialog Boxes - Knowing when it terminates, Terminate without using delete Dlg and Getting input Focus

3. Rich edit control and having a hypertext control to send the messages to windows

Hi

Here is the code to detect that if a click is made on word "START". But
I have many "START" word  Is there any way to detect which "START" word
has been clicked?

Please Let me know if any
Thanks
Anup


void CRichEditGSDlg::OnLinkRicheditStatic(NMHDR* pNMHDR, LRESULT*
pResult)
{
ENLINK *pLink = reinterpret_cast<ENLINK *>(pNMHDR);
  FINDTEXTEX findText;
  *pResult = 0;
  if( pLink->msg == WM_LBUTTONDOWN )
    { long lStart = pLink->chrg.cpMin;
	  long lEnde  = pLink->chrg.cpMin;
      m_Ctrl_RichEditStatic.SetSel(pLink->chrg);
	  CString strLink = m_Ctrl_RichEditStatic.GetSelText();
	  if( 0 == strLink.CompareNoCase(_T("START")) )
	    {
          GetTopLevelParent()->Sendmessage(WM_START_CHAT_WITH,0,0);
//START with the person below whom the start link is clicked.
          } 
	 
	  m_Ctrl_RichEdit.SetFocus();
	}	
}

4. IP Address Edit Control -- am I going mad? - Delphi VCL Component

5. Newbie Question: Print edit control contents

Hi,

I am new to VC++ and MFC and I am trying to print the contents of a
multi-line edit control.  The contents will be somewhat formatted (I.E. Date
followed by user entered notes followed by 2 empty lines).  What I would
like to do is create a simple header for my printing that give a report name
and possibly a page number.  It is possible that the edit control may
contain more text they will print on a single page which means I may have to
account for multiple pages.

Currently I am opening the CPrintDialog to allow the user to select a
printer but I am not sure how to access the contents on the edit control and
how then to get it properly formatted to the printer.  Is their a simple way
to do this?  Also, since my edit control can contain more lines that are
longer then the page is wide, will this have to be accounted for?

Thanks!

-Chris


6. Getting the contents of a TEXTAREA from a control in an embedded frame

7. Getting a handle to the contents of a window's contents

Hi everyone,
What Windows API should I use if I wanted to access the contents of a
window's contents. For instance, if I were to open a file in Word, or
browse a site using Explorer, how would I parse the text that I am
viewing?

TIA

Paul

8. Getting value from edit control?