home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / msdos / programm / 10566 < prev    next >
Encoding:
Text File  |  1992-11-12  |  1.4 KB  |  45 lines

  1. Newsgroups: comp.os.msdos.programmer
  2. Path: sparky!uunet!munnari.oz.au!bunyip.cc.uq.oz.au!cltr.uq.OZ.AU!bruceb
  3. From: bruceb@ctpm.uq.oz.au (Bruce Blackshaw)
  4. Subject: Re: Disabling return in a dialog box
  5. Message-ID: <bruceb.721551282@babel.cltr.uq.oz.au>
  6. Sender: news@cltr.uq.OZ.AU (Mr. Time Waster)
  7. Nntp-Posting-Host: pest.ctpm.uq.oz.au
  8. Organization: Centre for Language Teaching and Research, Uni of Queensland, AUSTRALIA.
  9. References: <bruceb.721545170@babel.cltr.uq.oz.au>
  10. Date: 12 Nov 92 06:54:42 GMT
  11. Lines: 32
  12.  
  13. bruceb@ctpm.uq.oz.au (Bruce Blackshaw) writes:
  14.  
  15. >I'm using a multiline edit box in a dialog box, and want to
  16. >stop the return key returning the dialog box - when the user
  17. >presses the return key it should take them to the next line
  18. >in the edit box.  Any ideas?  Please email replies.  If there is
  19. >sufficient interest I'll post the (hopefully) solution.
  20.  
  21. Solved.  It wasn't that hard after all.  Simple trap the return key
  22. using the below:
  23.    
  24.      void WMKeyDown(RTMessage Msg)
  25.      {
  26.        if (Msg.WParam == VK_RETURN)
  27.        {
  28.           SendMessage(HWindow, WM_CHAR, '\n', 0);
  29.           SendMessage(HWindow, WM_CHAR, '\t', 0);
  30.        }
  31.        else
  32.          DefWndProc(Msg);
  33.      }
  34.  
  35.  
  36. and replace it with \n\t so that the new line appears in the edit box.
  37.  
  38. Bruce.
  39.  
  40. --
  41. ****************************************************
  42. Bruce Blackshaw bruceb@ctpm.uq.oz.au   
  43. "... I'd rather be hang gliding ..."
  44. ****************************************************
  45.