.NET

Reply
Active Contributor
Posts: 39
Registered: ‎07-26-2005
Message 1 of 3 (102 Views)

Enter key behavour Multiline textbox on palette?

102 Views, 2 Replies
09-13-2006 09:32 PM
I am having trouble starting a new line with the enter key in a text box on a palette. I can load text with enters and it displays the return on the next line but when i press enter it do not return to the next line. I have set:
Multiline =True
Wordwrap = false
AcceptsTab=true
AcceptsEnter=True
*Tony Tanzillo
Message 2 of 3 (102 Views)

Re: Enter key behavour Multiline textbox on palette?

09-14-2006 09:01 PM in reply to: Mahersy
Use this control in lieu of the TextBox, and it should
solve the problem:

//////////////////////////////////////////////////////////////
using System.Windows.Forms;

namespace CaddZone.AutoCAD.UI.Controls
{

public class MultilineTextBox : System.Windows.Forms.TextBox
{
public MultilineTextBox()
: base()
{
this.Multiline = true;
}

const int DLGC_WANTCHARS = 0x0080;
const int WM_GETDLGCODE = 0x0087;

protected override void WndProc( ref Message m )
{
if( this.AcceptsReturn && m.Msg == WM_GETDLGCODE )
m.Result = new IntPtr( DLGC_WANTCHARS );
else
base.WndProc( ref m );
}
}
}


//////////////////////////////////////////////////////////////

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5328599@discussion.autodesk.com...
I am having trouble starting a new line with the enter key in a text box on a palette. I can load text with enters and it displays the return on the next line but when i press enter it do not return to the next line. I have set:
Multiline =True
Wordwrap = false
AcceptsTab=true
AcceptsEnter=True
Active Contributor
Posts: 39
Registered: ‎07-26-2005
Message 3 of 3 (102 Views)

Re: Enter key behavour Multiline textbox on palette?

09-17-2006 04:49 PM in reply to: Mahersy
Thank for the help.
For the c# handycaped like me

Imports System.Windows.Forms

Namespace CaddZone.AutoCAD.UI.Controls

Public Class MultilineTextBox
Inherits System.Windows.Forms.TextBox
Public Sub New()
Me.Multiline = True
End Sub

constant DLGC_WANTCHARS as Interger = &H80
constant WM_GETDLGCODE as Integer= &H87

Protected Overrides Sub WndProc(ByRef m As Message)
If Me.AcceptsReturn And m.Msg = WM_GETDLGCODE Then
m.Result = New IntPtr(DLGC_WANTCHARS)
Else
MyBase.WndProc( m)
End If
End Sub
End Class
End Namespace Message was edited by: Mahersy

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community