Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Disappearing Tab Controls
 

Disappearing Tab Controls

Hi All,

I need serious help here...

Why is it that all the controls on your form disappear during run time? It looks as ifI haven’t started creating the form. I'm using Visual Studio .Net 2003.

On my form I’ve got a Tab Control with several Tab Pages. On the one Tab Page for instance I’ve got a Combo box which is populated on the Load event of the Form using data in my database (SQL).

When it happened the first time I consulted the Internet for answers. Unfortunately I do not have the link anymore where I saw from one of the posts that I should install service pack 2, which I did. Now, almost 2 months later, again the same happens.

Do you have a solution for me???????

Thanx in advance

Sonett  Friday, June 29, 2007 12:19 PM

Your Constructor is missing the call to InitializeComponent()

Also, Your TabControl has it's Visible property set to false.

Mick Doherty  Monday, July 02, 2007 10:17 PM

Hi,I have tested following code ,there is no problem

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim ds As New DataSet

Dim strConn As String

Dim da As SqlDataAdapter

Dim conn As SqlConnection

New SqlConnection(strConn)

New SqlDataAdapter("Select * from Categories", conn)

Me.ComboBox1.DisplayMember = "CategoryName"

Me.ComboBox1.ValueMember = "CategoryID"

Me.ComboBox1.DataSource = ds.Tables(0)

End Sub

Hope it helps

Gavin Jin - MSFT  Monday, July 02, 2007 3:01 AM

Hi Gavin,

Thanx,

My problem is not with the population of the controls. The problem is that somewhere along the line all my controls disappear in run-time. I’m working with C# but I know VB.net code as well. The one minute when I run my application everything works and all is fine but the next moment when I run my application the form has no controls. I even tried to copy the code into a new project but that doesn’t help a bit. The only solution is to start from scratch which wastes time. I can’t put my finger on it but I think that somewhere the TabControl and TabPages has a problem. This is the second time�I’m really frustrated with this problem as I don’t know what is wrong. I can’t see anything funny in the code. I compared the code to another example that works 100% and it looks the same.

I installed service pack 2 after the first time it happened, but that doesn’t seem to have solved the problem.

Sonett

Sonett  Monday, July 02, 2007 6:50 AM
It seems a little weird.Could you paste some code ?
Gavin Jin - MSFT  Monday, July 02, 2007 9:09 AM

Gavin,

It's difficult to send you pieces of code as I don't know where the problem resides. The source codeis a zip folder with an example of one of my student's exercises.

Again, during design time all seems fine, but during run-time everything disappears...

Thanx again,

Sonett

Sonett  Monday, July 02, 2007 2:46 PM

Your Constructor is missing the call to InitializeComponent()

Also, Your TabControl has it's Visible property set to false.

Mick Doherty  Monday, July 02, 2007 10:17 PM

Thanx, that helped...

Do you maybe have an idea why the InitializeComponent()will disappear and the Visible property change to false? I know for a fact that we did not change that..

Sonett  Tuesday, July 03, 2007 7:42 AM

You can use google to search for other answers

Custom Search

More Threads

• Design time on mouse over event?
• Resources For Custom Controls
• Disable mouseDoubleClick on form (WndProc)
• Event Handling query
• IWindowsFormsEditorService designing a checkbox group and radio buttons
• Problems with the "(Name)" Property when I implements IExtenderListService
• Running an application offline and send updates to the database later
• Control like in debugger (mix of TreeView and ListView)
• progress bar in windows application till the query executes
• Drag n' drop