Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / April 2005

Tip: Looking for answers? Try searching our database.

Disappearing Controls when the designer loads a form.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michael AbiEzzi - 18 Feb 2005 23:31 GMT
I am using Visual Studio 2003 (C#) with the .NET Framework 1.1 SP1.

I suspect that I have encountered a bug in Visual Studio.  I have  three
user controls (EditorGrid, EditableGrid, and ReadOnlyGrid) which inherit from
Abstract Grid. AbstractGrid Inherits from TitledFrame and TitledFrame
inherits from ContainerControl. Anyways, the three user controls that inherit
from AbstractGrid can be dropped onto a form with a designer, and everything
will work fine. But if you try to drop it on a TabPage, we get trouble. At
first if you just drop it on the TabPage, save, and close the designer
window, then compile, there are no problems. But if you drop it on the
TabPage and compile while the designer is still open the control disappears
and the two following errors occur:

The variable 'editorGrid1' is either undeclared or was never assigned.
There is already a component named 'editorGrid1'.  Components must have
unique names, and names must be case-insensitive.  A name also cannot
conflict with the name of any component in an inherited class.

So basically, the anomaly occurs when the design reloads (Either when
opening a form in a designer, or when recompiling while the designer is still
open.)

The workaround is to selected the control from the Properties Window's
Object list (the dropdown list with all the controls and components in it),
then click on the designers document tab do shift focus to the designer. Then
press Ctrl+X to cut the control, then focus to the TabPage that you want the
control to be on, and then press Ctrl+V to paste it where it belongs. At this
time you can save your changes, and close the designer before recompiling,
and then you will be fine. The form will run just fine, without any problems.
It just becomes annoying when you want to use the designer to have to keep
cutting and pasting the controls back where the belong. Especially if one
form has seven to ten controls on it.

Since all three controls that inherit from AbstractGrid have this problem,
it is probably safe to deduce that something in that class is triggering the
anomaly. It was working at one point, but as I added more code to it, the
anomaly started occurring. I wasn’t able to find out what part of the code is
causing this to happen. I'll paste the AbstractGrid code and the code from
the class that it derives from below.

One thing I did do, was convert the project to run in visual studio .net
2005 beta, and the anomaly went away. That makes me suspect that is a VS 2003
issue, and not my code (my code just seems to trigger the bug some how).
Unfortunately, this project can’t built on a beta SDK, and we cant wait for
2005 to be released, so I’m hoping that there’s a solution for VS 2003.

So just to be clear, TitledFrame, the class the AbstractGrid inherits from,
does not have any problems. And AbstractGrid didn’t have any problems until I
made simply changes such as maybe changing implementations of methods or
adding properties, events, and event handling. Lastly, I wasn’t able to pin
point the code causing the problem no matter how hard I tried, that’s why I
am posting this message.

Thank you for taking the time to read this.

//-------------------------------------------------------------------------------

using System;
using System.Data;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using PointeBlank.Foundation.Controls;
using PointeBlank.Foundation.Data;
using PointeBlank.Foundation.UIManagement;
using Infragistics.Win.UltraWinGrid;
using Infragistics.Win;

namespace PointeBlank.HomePointe.UserControls
{

 public abstract class AbstractGrid : TitledFrame
 {

   #region Feilds

   protected Infragistics.Win.UltraWinGrid.UltraGrid grid = null;
   private string visibleColumns = "*";
   private string readOnlyColumns = "";
   private ArrayList readOnlyColumnsList;
   private string columnAliases = "";
   private bool autoFitColumns = false;
   private bool columnHeadersVisible = true;
   protected string recordTypeName = "record";
   private Hashtable storedProcedures = new Hashtable();
   private Hashtable inputValues = new Hashtable();
   private Hashtable listKeys = new Hashtable();
   private Hashtable codeTypes = new Hashtable();
   private ListLoader listLoader;
   private bool areGridEventsSetup = false;
   protected DataTable dataTable;
   private UIMessageHandler messageHandler;
   private ControlGuiDecorator controlGuiDecorator;
   private object director;
   
   #endregion

   #region Properties
   
   public UIMessageHandler MessageHandler
   {
     get{ return messageHandler; }
     set{ messageHandler = value; }
   }
   
   public ControlGuiDecorator ControlGuiDecorator
   {
     get{ return controlGuiDecorator; }
     set{ controlGuiDecorator = value; }
   }

   public ListLoader ListLoaderForComboColumns
   {
     get{ return listLoader; }
     set{ listLoader = value; }
   }

   [DefaultValue("*")]
   [Category("Appearance"), Description("Gets/sets the columns that are
visible or not " +
     "(Type in the column names seperated by commas).")]
   public string VisibleColumns
   {
     get{ return visibleColumns; }
     set{ visibleColumns = value; }
   }

   [DefaultValue("")]
   [Category("Appearance"), Description("Gets/sets the columns that are
read-only or not " +
     "(Type in the column names seperated by commas).")]
   public string ReadOnlyColumns
   {
     get{ return readOnlyColumns; }
     set{ readOnlyColumns = value; }
   }

   [DefaultValue("*")]
   [Category("Appearance"), Description("Gets/sets column aliases (i.e.
nme=Name, phn=Phone).")]
   public string ColumnAliases
   {
     get{ return columnAliases; }
     set{ columnAliases = value; }
   }

   [DefaultValue(false)]
   [Category("Appearance"), Description("Gets/sets if the columns are
autofit or not.")]
   public bool AutoFitColumns
   {
     get{ return autoFitColumns; }
     set{ autoFitColumns = value; }
   }

   [DefaultValue(true)]
   [Category("Appearance"), Description("Gets/sets if column header portion
is visible or not.")]
   public bool ColumnHeadersVisible
   {
     get{ return columnHeadersVisible; }
     set{ columnHeadersVisible = value; }
   }
   
   /// <summary>
   /// Specifies the name that you call an individual record.
   /// This name will be used in messages boxes. (i.e. "The Phone
   /// Number was not saved." (Where 'Phone Number' is the RecordTypeName.) )
   /// </summary>
   [DefaultValue("record")]
   [Category("Appearance")]
   [Description("Specifies the name that you call an individual record."+
      " This name will be used in messages boxes. (i.e. \"The Phone "+
      "Number was not saved.\" (Where 'Phone Number' is the
RecordTypeName.) )")]
   public string RecordTypeName
   {
     get { return recordTypeName; }
     set { recordTypeName = value; }
   }

   public UltraGrid Grid
   {
     get { return grid; }
   }

   #endregion

   #region Event Methods

   private void grid_AfterRowUpdate(object sender, RowEventArgs e)
   {
     if(AfterRowUpdate!=null)
       AfterRowUpdate(sender, null);
   }

   private void grid_BeforeEnterEditMode(object sender, CancelEventArgs e)
   {
     if(readOnlyColumnsList!=null)
       if(readOnlyColumnsList.Contains(grid.ActiveCell.Column.Key))
         e.Cancel = true;
   }

   #endregion

   #region Methods
   
   /// <summary>
   /// Displays a column as drop down list.
   /// </summary>
   /// <param name="column">
   /// The target column.
   /// </param>
   /// <param name="listSource">
   /// Either a codes type mnemonic or a stored procedure.
   /// This parameter will be passed to the list loader in order to
retreive the list.
   /// </param>
   public void DisplayColumnAsDropDownList( string column, object listKey,
string codeType )
   {
     if(listLoader==null)
       throw new ApplicationException("You must specify a ListLoader before
you can call the "+
         "DisplayColumnAsDropDownList method.");
     if(storedProcedures.Contains(column))
       storedProcedures.Remove(column);
     listKeys[column] = listKey;
     codeTypes[column] = codeType;
   }

   /// <summary>
   /// Displays a column as drop down list.
   /// </summary>
   /// <param name="column">
   /// The target column.
   /// </param>
   /// <param name="listSource">
   /// Either a codes type mnemonic or a stored procedure.
   /// This parameter will be passed to the list loader in order to
retreive the list.
   /// </param>
   public void DisplayColumnAsDropDownList( string column, object listKey,
StoredProcedure storedProcedure,
     Hashtable inputParameterValues)
   {
     if(listLoader==null)
       throw new ApplicationException("You must specify a ListLoader before
you can call the "+
         "DisplayColumnAsDropDownList method.");
     if(codeTypes.Contains(column))
       codeTypes.Remove(column);
     listKeys[column] = listKey;
     storedProcedures[column] = storedProcedure;
     inputValues[column] = inputParameterValues;
   }

   /// <summary>
   /// Displays a column as drop down list.
   /// </summary>
   /// <param name="column">
   /// The target column.
   /// </param>
   /// <param name="listSource">
   /// Either a codes type mnemonic or a stored procedure.
   /// This parameter will be passed to the list loader in order to
retreive the list.
   /// </param>
   public void DisplayColumnAsDropDownList( string column, object listKey,
     StoredProcedure storedProcedure)
   {
     DisplayColumnAsDropDownList( column, listKey, storedProcedure, null );
   }

   #endregion

   #region Some IGrid, IField Default Members for Deriving Classes

   #region Properties

   public object Director
   {
     get { return director; }
     set { director = value; }
   }

   public DataTable DataSource
   {
     get { return (DataTable)dataTable; }
   }

   public DataView DataView
   {
     get{ return (DataView)grid.DataSource; }
   }

   public object Value
   {
     get { return dataTable; }
     set
     {
       if(value is DataTable)
       {
         if(DataSourceChanging!=null)
         {
           CancelableValueEventArgs cv = new CancelableValueEventArgs(
value );
           DataSourceChanging(this, cv);
           if(cv.Cancel)
             return;
         }
         // apply autofit
         grid.DisplayLayout.AutoFitColumns = autoFitColumns;
         // set the grids datasource
         dataTable = (DataTable)value;
         grid.DataSource = new DataView((DataTable)value);
         // customize the grid
         if( visibleColumns!="*" )
         {
           // hide all the columns
           foreach(UltraGridColumn c in grid.DisplayLayout.Bands[0].Columns)
             c.Hidden = true;
           // show only the columns specified in the VisibleColumns property
           string[] visCols = visibleColumns.Split(',', ';');
           for (int i = 0; i < visCols.Length; i++)
             visCols[i] = visCols[i].Trim();
           foreach(DataColumn c in ((DataTable)value).Columns)
             foreach(string s in visCols)
               if(s==c.ColumnName)
                 grid.DisplayLayout.Bands[0].Columns[c.Ordinal].Hidden =
false;
         }
         // apply column aliases
         string[] colAliases = columnAliases.Split(',', ';');
         Hashtable aliases = new Hashtable(colAliases.Length);
         foreach(string s in colAliases)
         {
           s.Trim();
           if(s.IndexOf("=")>-1)
           {
             string[] keyValue = s.Split('=');
             aliases[keyValue[0].Trim()] = keyValue[1].Trim();
           }
         }
         foreach(UltraGridColumn c in grid.DisplayLayout.Bands[0].Columns)
           if(aliases.Contains(c.Key))
             c.Header.Caption = (string)aliases[c.Key];
         // apply read only columns
         if(readOnlyColumns.Length>0 && readOnlyColumnsList==null )
         {
           if(readOnlyColumns=="*")
           {
             readOnlyColumnsList = new
ArrayList(grid.DisplayLayout.Bands[0].Columns.Count);
             foreach( UltraGridColumn column in
grid.DisplayLayout.Bands[0].Columns)
             {
               column.TabStop = false;
               readOnlyColumnsList.Add(column.Key);
             }
           }
           else
           {
             string[] readOnlyCols = readOnlyColumns.Split(',', ';');
             readOnlyColumnsList = new ArrayList(readOnlyCols.Length);
             foreach(string s in readOnlyCols)
             {
               string columnName = s.Trim();
               readOnlyColumnsList.Add(columnName);
               if(grid.DisplayLayout.Bands[0].Columns.Exists(columnName))
                 grid.DisplayLayout.Bands[0].Columns[columnName].TabStop =
false;
               else
                 throw new ApplicationException("The read-only column '"+
columnName +
                   "' does not exist.");
             }
           }
         }
         if(!areGridEventsSetup)
         {
           grid.BeforeEnterEditMode += new
CancelEventHandler(grid_BeforeEnterEditMode);
           grid.AfterRowUpdate += new RowEventHandler(grid_AfterRowUpdate);
           grid.BeforeCellListDropDown += new
CancelableCellEventHandler(grid_BeforeCellListDropDown);
           areGridEventsSetup = true;
         }
         // apply columnHeadersVisible
         if(!columnHeadersVisible)
           grid.DisplayLayout.Bands[0].ColHeadersVisible = false;
         // apply drop down lists to columns
         foreach(object o in listKeys.Keys)
         {
           string key = (string)o;
           if(grid.DisplayLayout.Bands[0].Columns.Exists(key))
           {
             // if a stored procedure is defined then
             if(storedProcedures.Contains(key))
               listLoader.GetList(listKeys[key] as string,
storedProcedures[key] as StoredProcedure,
                 inputValues[key] as Hashtable);
             else if(codeTypes.Contains(key))
               listLoader.GetList(listKeys[key] as string, codeTypes[key]
as string);
             else
               throw new ApplicationException("Could not find list type for
column drop down list");
             UltraGridColumn column =
grid.DisplayLayout.Bands[0].Columns[key];
             column.Style = ColumnStyle.DropDownList;
             if(column.EditorControl==null)
             {
               column.EditorControl = new UltraCombo();
               UltraCombo combo = ((UltraCombo)column.EditorControl);
               if(controlGuiDecorator!=null)
                 controlGuiDecorator.DecorateUltraCombo(combo);
               combo.Left = -10000;
               this.Controls.Add(combo);
             }
             listLoader.BindList(listKeys[key] as string,
(UltraCombo)column.EditorControl);
           }
         }
       }
       if(LoadAction!=null)
         LoadAction(null,null);
     }
   }

   public DataRow[] SelectedRows
   {
     get
     {
       DataRow[] rows = null;
       if(grid.ActiveRow!=null)
         if(grid.ActiveRow.IsAddRow)
           rows = new DataRow[0];
       if(dataTable!=null && rows==null)
         rows = new DataRow[grid.Selected.Rows.Count];
       else
         rows = new DataRow[0];
       int i = 0;
       if(rows.Length>0)
         foreach(UltraGridRow r in grid.Selected.Rows)
           rows[i++] = dataTable.Rows[r.Index];
       return rows;
     }
   }

   #endregion

   #region Methods
   
   public bool ShouldDelete()
   {
     DialogResult dr = this.messageHandler.DisplayMessage(207,
MessageBoxButtons.YesNo, recordTypeName.ToLower());
     //DialogResult dr = MessageBox.Show(this, new
PointeBlank.Foundation.Utilities.WordWrapper(50,
      // "Are you sure you want to remove this " + recordTypeName.ToLower()
+"?").ToString()
       //, "Confirm Remove", MessageBoxButtons.YesNo,
       //MessageBoxIcon.Question);
     switch(dr)
     {
       case DialogResult.Yes:    return true;
       default:                  return false;
     }
   }
       
   public void DeleteAllSelectedRows()
   {
     grid.DeleteSelectedRows();
   }

   #endregion

   #region Events

   public event EventHandler LoadAction;

   public event EventHandler AfterRowUpdate;

   public event CancelableValueEventHandler DataSourceChanging;

   #endregion

   #endregion

   private void grid_BeforeCellListDropDown(object sender,
CancelableCellEventArgs e)
   {
     if(e.Cell.Column.EditorControl!=null)
       e.Cell.Column.EditorControl.Width = e.Cell.Column.Width;
   }

 }

}

//--------------------------------------------------------------------------------

/// <author>Michael AbiEzzi</author>
/// <creationDate>9/27/2004</creationDate>

using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using Infragistics.Win;
using System.ComponentModel.Design;

namespace PointeBlank.Foundation.Controls
{

 /// <summary>
 /// This control acts as a container for other controls and has the
flexibility
 /// to take advantage of the appearance and text properties of an
UltraLabel control.
 /// </summary>
 [DefaultEvent("TitleClick")]
 public class TitledFrame : ContainerControl
 {

   #region Fields

   private System.ComponentModel.Container components = null;
   
   private System.Windows.Forms.Label leftBorder;
   private System.Windows.Forms.Label rightBorder;
   private System.Windows.Forms.Label topBorder;
   private System.Windows.Forms.Label bottomBorder;
   
   private Infragistics.Win.Misc.UltraLabel title;
   private Infragistics.Win.Misc.UltraLabel bottom;
   
   private bool displayTitleAsLink;
   
   private EventHandler enterTitle;
   private EventHandler leaveTitle;

   private Color linkColor;
   private Color activeLinkColor;
   
   #endregion

   #region Properties
   
   /// <summary>
   /// Property allows the user of this control to set a title for the frame.
   /// </summary>
   [DefaultValue(null)]
   [Category("Appearance")]
   public override string Text
   {
     get{return title.Text;}
     set
     {
       title.Text = value;
       if(TextChanged!=null)
         TextChanged(this, new EventArgs());
     }
   }

   /// <summary>
   /// Property allows the user of this control to set the appearance of
title.
   /// </summary>
   [DefaultValue(null)]
   [Category("Appearance")]
   public Infragistics.Win.Appearance TitleAppearance
   {
     get{return (Infragistics.Win.Appearance)title.Appearance;}
     set
     {
       title.Appearance = value;
       if(displayTitleAsLink)
         DisplayTitleAsLink = true;
     }
   }

   [DefaultValue(null)]
   [Category("Appearance")]
   public Infragistics.Win.Appearance BottomAppearance
   {
     get{return (Infragistics.Win.Appearance)bottom.Appearance;}
     set{bottom.Appearance = value;}
   }

   [Category("Appearance")]
   public Color BorderColor
   {
     get{return rightBorder.BackColor;}
     set
     {
       rightBorder.BackColor =
         leftBorder.BackColor =
         topBorder.BackColor =
         bottomBorder.BackColor = value;
     }
   }

   [DefaultValue(1)]
   [Category("Appearance")]
   public int BorderWidth
   {
     get{return rightBorder.Size.Width;}
     set
     {
       rightBorder.Size =
         leftBorder.Size = new System.Drawing.Size(value,
rightBorder.Size.Height);
       topBorder.Size =
         bottomBorder.Size = new System.Drawing.Size(topBorder.Size.Width,
value);
     }
   }

   [DefaultValue(true)]
   [Category("Appearance")]
   public bool ShowBottom
   {
     get{return bottom.Visible;}
     set{bottom.Visible = value;}
   }

   [DefaultValue(true)]
   [Category("Appearance")]
   public bool ShowTitle
   {
     get{return title.Visible;}
     set{title.Visible = value;}
   }

   [DefaultValue(false)]
   [Category("Appearance")]
   public bool DisplayTitleAsLink
   {
     get{return displayTitleAsLink;}
     set
     {
       displayTitleAsLink = value;
       if(displayTitleAsLink)
       {
         title.Appearance =
(Infragistics.Win.Appearance)title.Appearance.Clone();
         title.Appearance.ForeColor = linkColor;
         title.Appearance.Cursor = Cursors.Hand;
         if(enterTitle==null) enterTitle = new EventHandler(EnterTitle);
         if(leaveTitle==null) leaveTitle = new EventHandler(LeaveTitle);
         title.MouseEnter += enterTitle;
         title.MouseLeave += leaveTitle;
       }
       else
       {
         title.Appearance.ForeColor = SystemColors.ControlText;
         title.Appearance.Cursor = Cursors.Default;
         if(enterTitle!=null) title.MouseEnter -= enterTitle;
         if(leaveTitle!=null) title.MouseLeave -= leaveTitle;
       }
     }
   }

   [Category("Appearance")]
   public Color LinkColor
   {
     get{return linkColor;}
     set
     {
       linkColor = value;
       if(displayTitleAsLink) title.Appearance.ForeColor = linkColor;  
     }
   }

   [Category("Appearance")]
   public Color ActiveLinkColor
   {
     get{return activeLinkColor;}
     set{activeLinkColor = value;}
   }

   #endregion

   #region Constructor/Destructor
   
   public TitledFrame()
   {
     InitializeComponent();
   }
 
   protected override void Dispose( bool disposing )
   {
     if( disposing )
     {
       if(components != null)
       {
         components.Dispose();
       }
     }
     base.Dispose( disposing );
   }

   #endregion

   #region Component Designer generated code
   /// <summary>
   /// Required method for Designer support - do not modify
   /// the contents of this method with the code editor.
   /// </summary>
   private void InitializeComponent()
   {
     this.leftBorder = new System.Windows.Forms.Label();
     this.rightBorder = new System.Windows.Forms.Label();
     this.topBorder = new System.Windows.Forms.Label();
     this.bottomBorder = new System.Windows.Forms.Label();
     this.title = new Infragistics.Win.Misc.UltraLabel();
     this.bottom = new Infragistics.Win.Misc.UltraLabel();
     this.SuspendLayout();
     //
     // leftBorder
     //
     this.leftBorder.BackColor = System.Drawing.SystemColors.Window;
     this.leftBorder.Dock = System.Windows.Forms.DockStyle.Left;
     this.leftBorder.Location = new System.Drawing.Point(345, 17);
     this.leftBorder.Name = "leftBorder";
     this.leftBorder.Size = new System.Drawing.Size(1, 160);
     this.leftBorder.TabIndex = 0;
     //
     // rightBorder
     //
     this.rightBorder.BackColor = System.Drawing.SystemColors.Window;
     this.rightBorder.Dock = System.Windows.Forms.DockStyle.Right;
     this.rightBorder.Location = new System.Drawing.Point(17, 17);
     this.rightBorder.Name = "rightBorder";
     this.rightBorder.Size = new System.Drawing.Size(1, 160);
     this.rightBorder.TabIndex = 0;
     //
     // topBorder
     //
     this.topBorder.BackColor = System.Drawing.SystemColors.Window;
     this.topBorder.Dock = System.Windows.Forms.DockStyle.Top;
     this.topBorder.Location = new System.Drawing.Point(244, 17);
     this.topBorder.Name = "topBorder";
     this.topBorder.Size = new System.Drawing.Size(230, 1);
     this.topBorder.TabIndex = 0;
     //
     // bottomBorder
     //
     this.bottomBorder.BackColor = System.Drawing.SystemColors.Window;
     this.bottomBorder.Dock = System.Windows.Forms.DockStyle.Bottom;
     this.bottomBorder.Location = new System.Drawing.Point(124, 17);
     this.bottomBorder.Name = "bottomBorder";
     this.bottomBorder.Size = new System.Drawing.Size(230, 1);
     this.bottomBorder.TabIndex = 0;
     //
     // title
     //
     this.title.BackColor = System.Drawing.Color.Transparent;
     this.title.Dock = System.Windows.Forms.DockStyle.Top;
     this.title.Location = new System.Drawing.Point(1, 1);
     this.title.Name = "title";
     this.title.Size = new System.Drawing.Size(230, 15);
     this.title.TabIndex = 0;
     this.title.Click += new EventHandler(this.title_Click);
     this.title.MouseUp += new
System.Windows.Forms.MouseEventHandler(this.title_MouseUp);
     this.title.MouseEnter += new EventHandler(this.title_MouseEnter);
     this.title.MouseLeave += new EventHandler(this.title_MouseLeave);
     this.title.MouseDown += new
System.Windows.Forms.MouseEventHandler(this.title_MouseDown);
     //
     // bottom
     //
     this.bottom.BackColor = System.Drawing.Color.Transparent;
     this.bottom.Dock = System.Windows.Forms.DockStyle.Bottom;
     this.bottom.Location = new System.Drawing.Point(1, 144);
     this.bottom.Name = "bottom";
     this.bottom.Size = new System.Drawing.Size(230, 15);
     this.bottom.TabIndex = 0;
     //
     // TitledFrame
     //
     this.Controls.Add(this.bottom);
     this.Controls.Add(this.title);
     this.Controls.Add(this.bottomBorder);
     this.Controls.Add(this.topBorder);
     this.Controls.Add(this.rightBorder);
     this.Controls.Add(this.leftBorder);
     this.Size = new System.Drawing.Size(232, 160);
     this.ResumeLayout(false);

   }
   #endregion

   #region Methods

   private void EnterTitle(object sender, EventArgs e)
   {
     if(displayTitleAsLink)
       title.Appearance.FontData.Underline =
Infragistics.Win.DefaultableBoolean.True;
   }

   private void LeaveTitle(object sender, EventArgs e)
   {
     if(displayTitleAsLink)
       title.Appearance.FontData.Underline =
Infragistics.Win.DefaultableBoolean.False;
   }

   #endregion

   #region Events

   [Category("Action"), Description("Fires when the title is clicked.")]
   public event EventHandler TitleClick;

   public new event EventHandler TextChanged;
   
   #endregion

   #region Event Methods

   private void title_Click(object sender, System.EventArgs e)
   {
     if(TitleClick!=null) TitleClick(sender,e);
   }

   private void title_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
   {
     if(displayTitleAsLink) title.Appearance.ForeColor = activeLinkColor;
   }

   private void title_MouseUp(object sender,
System.Windows.Forms.MouseEventArgs e)
   {
     if(displayTitleAsLink) title.Appearance.ForeColor = linkColor;
   }

   private void title_MouseEnter(object sender, System.EventArgs e)
   {
     if(displayTitleAsLink) title.Appearance.FontData.Underline =
DefaultableBoolean.True;
   }

   private void title_MouseLeave(object sender, System.EventArgs e)
   {
     if(displayTitleAsLink) title.Appearance.FontData.Underline =
DefaultableBoolean.False;
   }

   #endregion

 }

}
Alex Clark - 08 Mar 2005 17:28 GMT
Hi Michael,

It's a known bug in VS.NET and Microsoft have got a hotfix for it, but you
need to contact PSS in order to get it as it's not "release" ready.  I
believe it is under KB842706.  I've installed it myself and although it's
not 100% perfect, it's certainly a major improvement (after screaming at the
screen and having to add 44 user controls back onto my main form from
scratch for about the 8th time, anything was an improvement!).

Cheers,
Alex

>I am using Visual Studio 2003 (C#) with the .NET Framework 1.1 SP1.
>
[quoted text clipped - 887 lines]
>
> }
Uri Dor - 06 Apr 2005 11:54 GMT
I had similar problems, which were traced to an exception my user
control threw while in the designer.
The easy way to debug this is to run one instance of VS.NET, open your
solution, change the project debugging properties from "project" to
"program" and specifying devenv.exe with the SLN file as a parameter.
then you start debugging, which loads another VS.NET. in that (the
debugged) VS.NET you do whatever reproduces your designer problem, and
the 1st VS.NET catches the exception (don't forget to turn on "break
into debugger when exception is thrown" in "exceptions")

worked for me

> I am using Visual Studio 2003 (C#) with the .NET Framework 1.1 SP1.
>
[quoted text clipped - 858 lines]
>
> }
joeycalisay - 07 Apr 2005 02:05 GMT
worked with everyone who knows how to debug... :p

Signature

Joey Calisay
http://spaces.msn.com/members/joeycalisay/

> I had similar problems, which were traced to an exception my user
> control threw while in the designer.
[quoted text clipped - 45 lines]
> > anomaly. It was working at one point, but as I added more code to it, the
> > anomaly started occurring. I wasn't able to find out what part of the
code is
> > causing this to happen. I'll paste the AbstractGrid code and the code from
> > the class that it derives from below.
[quoted text clipped - 3 lines]
> > issue, and not my code (my code just seems to trigger the bug some how).
> > Unfortunately, this project can't built on a beta SDK, and we cant wait
for
> > 2005 to be released, so I'm hoping that there's a solution for VS 2003.
> >
> > So just to be clear, TitledFrame, the class the AbstractGrid inherits from,
> > does not have any problems. And AbstractGrid didn't have any problems
until I
> > made simply changes such as maybe changing implementations of methods or
> > adding properties, events, and event handling. Lastly, I wasn't able to
pin
> > point the code causing the problem no matter how hard I tried, that's
why I
> > am posting this message.
> >
> > Thank you for taking the time to read this.

//--------------------------------------------------------------------------
-----

> > using System;
> > using System.Data;
[quoted text clipped - 309 lines]
> >                 string columnName = s.Trim();
> >                 readOnlyColumnsList.Add(columnName);

if(grid.DisplayLayout.Bands[0].Columns.Exists(columnName))

grid.DisplayLayout.Bands[0].Columns[columnName].TabStop =
> > false;
> >                 else
[quoted text clipped - 29 lines]
> >               else if(codeTypes.Contains(key))
> >                 listLoader.GetList(listKeys[key] as string,
codeTypes[key]
> > as string);
> >               else
[quoted text clipped - 92 lines]
> >
> > }

//--------------------------------------------------------------------------
------

> > /// <author>Michael AbiEzzi</author>
> > /// <creationDate>9/27/2004</creationDate>
[quoted text clipped - 354 lines]
> >
> > }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.