[Mono-winforms-list] OSX TextBox accepts no input?

ultraviolet7 ultraviolet7 at gmail.com
Tue Jan 20 23:13:23 EST 2009


You need to add "this.Controls.Add(tb);" towards the end of your constructor.
http://msdn.microsoft.com/en-us/library/aa287574(VS.71).aspx



gohanman wrote:
> 
> I'm kind of baffled by this. I can create a Form object and add a TextBox
> object to it. I can give the TextBox focus and get a cursor. Nothing I
> type while the TextBox has focus shows up. gmcs and mono both report
> version 1.9. Code follows:
> 
> using System.Windows.Forms;
> using System.Drawing;
> 
> public class MyC : Form
> {
>     public MyC()
>     {   
>         Text = "Simple";
>         Size = new Size(250, 200);
>         TextBox tb = new TextBox();
>         tb.Parent = this;
>         tb.Location = new Point(5,5);
>         tb.Size = new Size(200,180);
>         tb.Multiline = true;
>         tb.ScrollBars = ScrollBars.Vertical;
>         tb.AcceptsReturn = true;
>         tb.AcceptsTab = true;
>         tb.WordWrap = false;
> 
>         CenterToScreen();
>     }
> 
>     static public void Main()
>     {  
>        Application.Run(new MyC());
>     }
> }
> 
> I'm compiling thusly:
> gmcs -r:System.Windows.Forms.dll -r:System.Drawing.dll MyC.cs
> 
> If there's something wrong with my code, I can't find it. Is this just a
> limitation of mono on OS X?
> 

-- 
View this message in context: http://www.nabble.com/OSX-TextBox-accepts-no-input--tp21567608p21576886.html
Sent from the Mono - WinForms mailing list archive at Nabble.com.



More information about the Mono-winforms-list mailing list