Windows Develop Bookmark and Share   
 index > Windows Forms General > Disappearing controls
 

Disappearing controls

Hi,

I have got a weird problem. I have a project composed by about 70 forms. On a regular basis I found out that controls are gone from the UI ! When going to the Windows Form Designer with the code editor I can see its definition but the code used to display it on the form is gone.

Here is the form in add mode (no reference made to the control yet) with the control gone (a text edit thing)

http://www.corobori.com/sos/200531522815_CCBase22.jpg

Here is the form in edit mode (where a reference is made)
http://www.corobori.com/sos/200531522922_CCBase23.jpg

The compile goes thru as the control is defined



    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.
    'Do not modify it using the code editor.
    Friend WithEvents lblSuspens As System.Windows.Forms.Label
    Friend WithEvents lblChampVide As System.Windows.Forms.Label
    Friend WithEvents Su_Texto As DevExpress.XtraEditors.TextEdit <--------------------------------


but I only notice it when running the application so it's difficult to spot.

This code 

Me.Controls.Add(Me.Su_Texto) '<-- adds control to the forms control collection 

(and any other reference to it) is gone

I contacted DevExpress and they haven't heard about this problem before. On UseNet they are several posts about it but none with a way around.

Anybody who saw that before ?

Any clue on how I should to make sure any control defined is dislayed on the screen ?

Is there a tool able to scan the controls defined in Private components As System.ComponentModel.IContainer but not referenced in Private Sub InitializeComponent()  ?
MigrationUser 1  Saturday, March 19, 2005 2:03 PM
I'm not sure what could be causing this.  Are you having this problem locally?  or is this something that occurs remotely?

It may be that you're referencing is off for your application.  Where you're referencing a dll through the "browse" when you should be selecting it through the list box.  

I've never seen something like this happening.  It's also in VB, so a lot of errors won't appear until runtime.  I'd try stepping through to make sure nothing sets it to nothing or that it does in fact get set.

there HAS to be 

Su_Texto = New DevExpress.XtraEditors.TextEdit() there somewhere also to instantiate it.

Copy/paste the full stack dump to help us see what the error is.
MigrationUser 1  Tuesday, March 22, 2005 12:40 AM

You can use google to search for other answers

Custom Search

More Threads

• Binding data from a SQL query to a checkedlistbox
• Duplicate Controls to New Panel
• Increasingly slow UI refresh rate when using multiple layers of modal forms
• GDI+ button image painting problem
• Setting Properties on Dialog Boxes?
• Listbox selected items
• Installer Project with Service name as a Parameter
• Populating the list view takes much time
• Component required build Email Editor in vb.net
• Binding a checkbox that is in a TabPage