Cannot move controls in the tablelayoutpanel in vb.net - vb.net

I am using visual studio 2013. So far I have a tablelayoutpanel in the Form1.vb[design], I dragged a Textbox(control) from the Toolbox, but I could not move the textbox within the tablelayoutpanel. What happenes here? How could I get around with it? Any hint will be appreciated.

I also faced the same problem when I was experimenting with TableLayoutPanel.
I couldn't figure out any change in code that might have resulted in this strange behavior but found a way around. Restart Visual Studio! :P
This actually helped and I could move my controls anywhere in the TableLayoutPanel.

In the properties change Anchor to "None".

Related

Accessing controls that were moved

I am returning to coding after a long hiatus, and have come across a tiny issue that has me baffled. What I'm trying to do is simple, and it worked perfectly until I copied the controls from the winform and placed them in a tab control.
Very simply, I have a yes/no combobox with a conditional statement making a date time picker visible if the combobox is set to "Yes". Since moving the controls into a tabcontrol (The project had so many controls, I had to condense them for space). What's really crazy is I have a subroutine that resets all the controls in the project, and it still works.
when it worked, it looked like this:
If cmbAssessment.SelectedIndex = 1 Then
dtpAssessment.Visible = True
End if
(TabControl is named tcNursing and form is frmNursing)
I just can't figure out how to reference these controls inside the Tab Control.
It seems like solutions from Googling the issue are very complex. I'm finding it hard to believe this is
a complex problem. Thank you for ANY assistance at all!
As it turns out, Jimi, you were on the right track. There was nothing obviously wrong with the event handlers, although deleting them and re-adding them solved the problem. Thank you all for your help in this matter!

Visual Studio Form Designer changes layout of controls on open

I have a user control that looks like this in the designer:
However, when I close the designer and open it again, it looks like this:
The eight controls that have moved are text boxes and labels that are all set to Anchor Top, Right while all the other controls have different anchoring.
Does anyone have any idea what is causing this change of layout, and more importantly, how it can be prevented?
I also had the problem of changing the layout of my form every time by opening it in design mode.
The problem was the use of the tool "TableLayoutPanel".
By coincidence I found that changing the property "Dock" solved the problem.
Just set to another value and then undo this.
After this is seems to be solved. Don't ask me why!

fix form size in visual studio

I am trying to design a web form in visual basic and i have a problem.I put all the elements(buttons, labels etc) in the place i want.When i run the form i have the option to maximize the screen of the form and when i do this,a blank space appears in the form where there are no elements and all my elements are shown to the left upper side of the form. I can't see that blank space when i am designing the form. Could you help me how to fix the fix the size?
I tried autosize,autoscroll and size properties but i didn't fix the problem.
You don't specify whether it's VB6 or VB.Net but for once, it doesn't matter much.
Look at the form property BorderStyle, and change it to one of the "fixed" options.
VB6 documentation
VB.Net documentation

Adding programmatically a control on top of others

I'm looking for adding a control on top of others controls during runtime.
I read that the only way of playing with the Z-Order of controls is by playing with the order of the controls inside the Form.Controls Collection. I find this solution very weird and weak and I'm looking for an alternative.
Does anyone has an idea? I just want to make some kind of modal dialog that'll show below another user control to notice the user that the user control is currently doing something.
Edit: I tried using Control.BringToFront() but it doesn't work at all.
Thanks a lot!
You're looking for the BringToFront() method.

VB.NET forms behave strange on design-time

I'm developing with VB.NET 2008.
One of my host was crashed, so I take the files and keep development on another host. But now something strange is happening:All frames, lines and shapes are disappeared on design-time, but are seen normally in runtime.
Please see the attached screenshot (Upper is design-time, lower is runtime).
http://gomidjets.com/forms.JPG
How do I fix this?
Update:
The shapes are GroupBox and LineShape. LineShape is part of "VisualBasic PowerPack" indeed.
If I try to add a line shape, it is added but invisible in the designer, while it's visible during the run-time.
Any idea?
If i was you i'd most definitely check the zorder.
As a last resort take the controls out of the groupbox and recreate the groupbox.
Also if you add a groupbox or a lineshape control on another form,does it work? if they do,you should check your code