Where is the problem
-
Hi I want to display the message in the following event procidure when a message is received by creating a control dynamically e.g. textbox to display the message. But the control is not created. Where is the bug in my code. Private Sub MessageReceivedEventHandler(ByVal data As String) Handles remote.MessageReceived Dim txt As New TextBox txt.Size = New Size(55, 25) txt.Location = New Point(x, y) txt.Name = "strServer" txt.Text = data Controls.Add(txt) End Sub Thanks
reman
-
Hi I want to display the message in the following event procidure when a message is received by creating a control dynamically e.g. textbox to display the message. But the control is not created. Where is the bug in my code. Private Sub MessageReceivedEventHandler(ByVal data As String) Handles remote.MessageReceived Dim txt As New TextBox txt.Size = New Size(55, 25) txt.Location = New Point(x, y) txt.Name = "strServer" txt.Text = data Controls.Add(txt) End Sub Thanks
reman
-
Amer Rehman wrote:
Dim txt As New TextBox txt.Size = New Size(55, 25) txt.Location = New Point(x, y) txt.Name = "strServer" txt.Text = data Controls.Add(txt)
Where does x and y in 'txt.Location = New Point(x, y)' comes from? Regards: Didi
Position in the form
-
Position in the form
It doesn't look like your changing the X and/or Y position, causing each textbox to be positioned directly under the last textbox that was added.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008