|
Hello: I am new to .NET and I am trying to create a simple application where i developed a control that allows you to draw different drawings. The control is derived from Control base class and I am doing my own painting logic. I have provided a context menu from which user can select the type of drawing like Rectangle Ellipse etc. I was planning to add a new feature where I want to allow user to type some text. So I added one more menu item to context menu called text... On click of that menu I wanted to display a textbox at the point of click. I tried to display the textbox onPaint but for some reason I don't see the text box at all. Am I missing something?
Here is my on paint.
onPaint(...) { ... if ( bShowTextBox) { if ( this.textBox1 == null ) this.textBox1 = new System.Windows.Forms.TextBox(); this.textBox1.Location = ptTextBoxLocation; this.textBox1.Size = new Size (300,100); this.textBox1.Name = "textBox1"; this.textBox1.TabIndex = 0; this.textBox1.Text = ""; this.textBox1.BringToFront (); this.textBox1.Visible= true; } }
|