<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : Multiline FlatEdit &amp; Default Controls</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Controls : Multiline FlatEdit &amp; Default Controls]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 28 Apr 2026 04:12:50 +0000</pubDate>
  <lastBuildDate>Mon, 27 Oct 2008 14:57:11 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=10788</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[Multiline FlatEdit &amp; Default Controls : I was hoping SetWindowLong with...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10788&amp;PID=42392&amp;title=multiline-flatedit-default-controls#42392</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 10788<br /><strong>Posted:</strong> 27 October 2008 at 2:57pm<br /><br />I was hoping SetWindowLong with ES_WANTRETURN would fix this problem, but I just tried it and it didn't help...This is the code I used (in case anyone notices a bug that would prevent it from working):<br><br><table width="99%"><tr><td><pre class="BBcode"><br>Option Explicit<br><br>Private Const ES_WANTRETURN = &amp;H1000<br>Private Const GWL_STYLE = (-16)<br>Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long<br>Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long<br><br>Private Sub Form_Load()<br>&nbsp;&nbsp; Dim l_Style As Long<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; ' Get current FlatEdit style<br>&nbsp;&nbsp; l_Style = GetWindowLong(Me.FlatEdit1.hwnd, GWL_STYLE)<br>&nbsp;&nbsp; ' Ensure ES_WANTRETURN style flag is set<br>&nbsp;&nbsp; SetWindowLong Me.FlatEdit1.hwnd, GWL_STYLE, l_Style Or ES_WANTRETURN<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; ' Test to see if ES_WANTRETURN style was set properly<br>&nbsp;&nbsp; l_Style = GetWindowLong(Me.FlatEdit1.hwnd, GWL_STYLE)<br>&nbsp;&nbsp; Debug.Print l_Style And ES_WANTRETURN&nbsp;&nbsp;&nbsp; ' Should print 4096 if set properly<br>End Sub<br><br>Private Sub PushButton1_Click()<br>&nbsp;&nbsp; ' Shouldn't fire when user hits Enter while FlatEdit1 has focus<br>&nbsp;&nbsp; ' Even when Default property = True<br>&nbsp;&nbsp; MsgBox "A"<br>End Sub<br></pre></td></tr></table><br>]]>
   </description>
   <pubDate>Mon, 27 Oct 2008 14:57:11 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10788&amp;PID=42392&amp;title=multiline-flatedit-default-controls#42392</guid>
  </item> 
  <item>
   <title><![CDATA[Multiline FlatEdit &amp; Default Controls : Can anyone from CJ say if this...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10788&amp;PID=42355&amp;title=multiline-flatedit-default-controls#42355</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2113">ijwelch</a><br /><strong>Subject:</strong> 10788<br /><strong>Posted:</strong> 26 October 2008 at 11:14pm<br /><br />Can anyone from CJ say if this is going to be changed for 12.1?]]>
   </description>
   <pubDate>Sun, 26 Oct 2008 23:14:08 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10788&amp;PID=42355&amp;title=multiline-flatedit-default-controls#42355</guid>
  </item> 
  <item>
   <title><![CDATA[Multiline FlatEdit &amp; Default Controls : Hi,  Yes, now I know what you...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10788&amp;PID=35893&amp;title=multiline-flatedit-default-controls#35893</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 10788<br /><strong>Posted:</strong> 28 May 2008 at 12:46am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>Yes, now I know what you mean. It looks more like a bug to me. I don't see this when I use a MS textbox (when focused ENTER is next line) and this is how it should be !!!</DIV>]]>
   </description>
   <pubDate>Wed, 28 May 2008 00:46:16 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10788&amp;PID=35893&amp;title=multiline-flatedit-default-controls#35893</guid>
  </item> 
  <item>
   <title><![CDATA[Multiline FlatEdit &amp; Default Controls : Hi Aaron,Did you put any code...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10788&amp;PID=35859&amp;title=multiline-flatedit-default-controls#35859</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 10788<br /><strong>Posted:</strong> 27 May 2008 at 9:43am<br /><br />Hi Aaron,<br><br>Did you put any code in your Button_Click event? Pressing the enter key at any time on a form with a Default button *should* be the same as clicking that button with the mouse (at least it has been that way in my experience). This is usually a desired result, but it is annoying when you need a multiline textbox on a form.<br>]]>
   </description>
   <pubDate>Tue, 27 May 2008 09:43:55 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10788&amp;PID=35859&amp;title=multiline-flatedit-default-controls#35859</guid>
  </item> 
  <item>
   <title><![CDATA[Multiline FlatEdit &amp; Default Controls : Jason,  Just curious, when I...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10788&amp;PID=35826&amp;title=multiline-flatedit-default-controls#35826</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3701">Aaron</a><br /><strong>Subject:</strong> 10788<br /><strong>Posted:</strong> 27 May 2008 at 12:51am<br /><br />Jason,<DIV>&nbsp;</DIV><DIV>Just curious, when I add a Flatedit and a button (set to default) to a form, the Enter key will set the focus to the button or what? In my case the flatedit does nothing at all with the Enter key (staying in focus thats what it does)</DIV>]]>
   </description>
   <pubDate>Tue, 27 May 2008 00:51:56 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10788&amp;PID=35826&amp;title=multiline-flatedit-default-controls#35826</guid>
  </item> 
  <item>
   <title><![CDATA[Multiline FlatEdit &amp; Default Controls : Hi,I thought I&amp;#039;d pass on...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10788&amp;PID=35824&amp;title=multiline-flatedit-default-controls#35824</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2676">jpbro</a><br /><strong>Subject:</strong> 10788<br /><strong>Posted:</strong> 27 May 2008 at 12:20am<br /><br />Hi,<br><br>I thought I'd pass on a helpful little code snippet that I am using. First some background:<br><br>When the FlatEdit control has its MultiLine property set to True and your form contains another control with the Default property set to True, hitting Enter/Return in the FlatEdit control will trigger the Default control. The user needs to press Ctrl+Enter in order to add newlines to the FlatEdit control in this scenario (which may be undesirable).<br><br>Here's some code that will temporarily hold the default control while the multiline FlatEdit has focus, and restore the default control when the FlatEdit control loses focus:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>Private Sub HoldDefaultControl(ByVal pHold As Boolean)<br>&nbsp;&nbsp; '---------------------------------------------------------------------------------------<br>&nbsp;&nbsp; ' Procedure&nbsp; : HoldDefaultControl<br>&nbsp;&nbsp; ' Purpose&nbsp;&nbsp;&nbsp; : To set/unset the default property of another control on the parent of<br>&nbsp;&nbsp; '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this usercontrol<br>&nbsp;&nbsp; ' Parameters : pHold - TRUE (hold a reference to the current default control and<br>&nbsp;&nbsp; '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set its Default property to FALSE)<br>&nbsp;&nbsp; '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FALSE (set the Default property of the held reference to the<br>&nbsp;&nbsp; '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; former default control to TRUE)<br>&nbsp;&nbsp; '---------------------------------------------------------------------------------------<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; Static sobjDefaultControl As Control<br>&nbsp;&nbsp; Dim objCtrl As Control<br>&nbsp;&nbsp; Dim blnFoundDefault As Boolean<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; ' Remove default control from parent if it exists so<br>&nbsp;&nbsp; ' user can hit enter in multiline textbox<br>&nbsp;&nbsp; If pHold Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If sobjDefaultControl Is Nothing Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Loop through the controls on the parent form until we find the default control<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For Each objCtrl In Me.Controls<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' Trap errors in case this control doesn't support default property<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; On Error Resume Next<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; blnFoundDefault = objCtrl.Default<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; On Error GoTo 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If blnFoundDefault Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' We have found the default control<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set sobjDefaultControl = objCtrl ' Store a reference to this control<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Exit For ' Short circuit the loop since we found what we were looking for<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Next objCtrl<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br>&nbsp;&nbsp; End If<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; If Not sobjDefaultControl Is Nothing Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ' If there is/was a default control<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sobjDefaultControl.Default = Not pHold ' Set or Unset the default property as required<br>&nbsp;&nbsp; End If<br>End Sub<br></pre></td></tr></table><br><br>And to use it:<br><br><table width="99%"><tr><td><pre class="BBcode"><br>Private Sub FlatEdit1_GotFocus()<br>&nbsp;&nbsp; If Me.MultiLine Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HoldDefaultControl True<br>&nbsp;&nbsp; End If<br>End Sub<br><br>Private Sub FlatEdit1_LostFocus()<br>&nbsp;&nbsp; HoldDefaultControl False<br>End Sub&nbsp;&nbsp;  <br></pre></td></tr></table><br><br>Hope this is helpful for someone!<br>]]>
   </description>
   <pubDate>Tue, 27 May 2008 00:20:43 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10788&amp;PID=35824&amp;title=multiline-flatedit-default-controls#35824</guid>
  </item> 
 </channel>
</rss>