473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Solution Explorer

This is a Winform.

One of my Winform icons is different than the rest displayed in the Solution
Explorer. Most of the form icon are small icon form with two text boxes and
two labels in front of the text boxes. But the odd icon, has three squares,
green square then a blue square then a red square on top of the blue square.

Why is this icon different for this win form? I went through all the
properties, same as the other forms.

Nov 17 '05 #1
6 2413
Hi Cadel,

This icon is used when the file is a Component Class or a Windows Service.
Please check what class is this class inherited from in the .cs file. A
component is inherited from System.ComponentModel.Component.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 17 '05 #2
Hi Cadel,

This icon is used when the file is a Component Class or a Windows Service.
Please check what class is this class inherited from in the .cs file. A
component is inherited from System.ComponentModel.Component.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 17 '05 #3
I compare the code to another form and its the same. The code for
System.ComponetModel.Component is set to Null, just like my other forms.

private System.ComponentModel.Container components = null;
Here is all the code of the form. I replaced the password for security.

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;

namespace LicenseDealerSales
{
/// <summary>
/// Summary description for frmDealerSearch.
/// </summary>
///
public class frmDealerSearch : System.Windows.Forms.Form
{
private System.Windows.Forms.Button cmdOk;
private System.Windows.Forms.Button cmdCancel;
private System.Windows.Forms.DataGrid dgDealerInfo;

/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;

public frmDealerSearch()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form 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()
{
System.Resources.ResourceManager resources = new
System.Resources.ResourceManager(typeof(frmDealerS earch));
this.cmdOk = new System.Windows.Forms.Button();
this.cmdCancel = new System.Windows.Forms.Button();
this.dgDealerInfo = new System.Windows.Forms.DataGrid();
((System.ComponentModel.ISupportInitialize)(this.d gDealerInfo)).BeginInit();
this.SuspendLayout();
//
// cmdOk
//
this.cmdOk.Location = new System.Drawing.Point(152, 152);
this.cmdOk.Name = "cmdOk";
this.cmdOk.Size = new System.Drawing.Size(112, 40);
this.cmdOk.TabIndex = 1;
this.cmdOk.Text = "&OK";
this.cmdOk.Click += new System.EventHandler(this.cmdOk_Click);
//
// cmdCancel
//
this.cmdCancel.Location = new System.Drawing.Point(336, 152);
this.cmdCancel.Name = "cmdCancel";
this.cmdCancel.Size = new System.Drawing.Size(112, 40);
this.cmdCancel.TabIndex = 2;
this.cmdCancel.Text = "&Cancel";
this.cmdCancel.Click += new System.EventHandler(this.cmdCancel_Click);
//
// dgDealerInfo
//
this.dgDealerInfo.Anchor =
((System.Windows.Forms.AnchorStyles)((((System.Win dows.Forms.AnchorStyles.Top
| System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgDealerInfo.DataMember = "";
this.dgDealerInfo.HeaderForeColor =
System.Drawing.SystemColors.ControlText;
this.dgDealerInfo.Location = new System.Drawing.Point(16, 16);
this.dgDealerInfo.Name = "dgDealerInfo";
this.dgDealerInfo.ReadOnly = true;
this.dgDealerInfo.Size = new System.Drawing.Size(576, 112);
this.dgDealerInfo.TabIndex = 0;
//
// frmDealerSearch
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 13);
this.BackColor = System.Drawing.Color.LightSteelBlue;
this.ClientSize = new System.Drawing.Size(610, 216);
this.ControlBox = false;
this.Controls.Add(this.cmdOk);
this.Controls.Add(this.cmdCancel);
this.Controls.Add(this.dgDealerInfo);
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,
((System.Byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this. Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "frmDealerSearch";
this.Text = "Dealer Search";
this.Load += new System.EventHandler(this.frmDealerSearch_Load);
((System.ComponentModel.ISupportInitialize)(this.d gDealerInfo)).EndInit();
this.ResumeLayout(false);

}
#endregion

private void cmdCancel_Click(object sender, System.EventArgs e)
{
this.DialogResult = DialogResult.Cancel;

}

private void cmdOk_Click(object sender, System.EventArgs e)
{
frmDataEntry f = new frmDataEntry();
f.SetTextBox("Test");

this.DialogResult = DialogResult.OK;
}

private void frmDealerSearch_Load(object sender, System.EventArgs e)
{
string sConnString = "Data Source=db;Database=License;Integrated
Security=False;User ID=sa;password=password";
string sProc = "prGet_DealerInfo";

using (SqlConnection oCn = new SqlConnection(sConnString))
{
using (SqlCommand oCmd = new SqlCommand(sProc, oCn))
{
oCn.Open();
oCmd.CommandType = CommandType.StoredProcedure;

oCmd.Parameters.Add("@sDealerNum", SqlDbType.NChar, 6);
oCmd.Parameters["@sDealerNum"].Value = "101043";

SqlDataAdapter oDa = new SqlDataAdapter();

oDa.SelectCommand = oCmd;
DataSet ds=new DataSet();
oDa.Fill(ds);
DataGridTableStyle tableStyle = new DataGridTableStyle();
tableStyle.MappingName="DealerInfo";

int numCols = ds.Tables[0].Columns.Count;
DataGridNoActiveCellColumn aColumnTextColumn ;
for(int i = 0; i < numCols; ++i)
{
aColumnTextColumn = new DataGridNoActiveCellColumn();
aColumnTextColumn.HeaderText = ds.Tables[0].Columns[i].ColumnName;

aColumnTextColumn.MappingName = ds.Tables[0].Columns[i].ColumnName;
tableStyle.GridColumnStyles.Add(aColumnTextColumn) ;
}
dgDealerInfo.TableStyles.Clear();
tableStyle.MappingName=ds.Tables[0].TableName;
dgDealerInfo.TableStyles.Add(tableStyle);
dgDealerInfo.DataSource = ds.Tables[0];


}
}
}

}
public class DataGridNoActiveCellColumn : DataGridTextBoxColumn
{
private int SelectedRow = -1;
protected override void Edit(System.Windows.Forms.CurrencyManager source,
int rowNum, System.Drawing.Rectangle bounds, bool readOnly,string
instantText,bool cellIsVisible)
{
//make sure previous selection is valid
if(SelectedRow > -1 && SelectedRow < source.List.Count + 1)
this.DataGridTableStyle.DataGrid.UnSelect(Selected Row);
SelectedRow = rowNum;
this.DataGridTableStyle.DataGrid.Select(SelectedRo w);
}
}
}
"Kevin Yu [MSFT]" wrote:
Hi Cadel,

This icon is used when the file is a Component Class or a Windows Service.
Please check what class is this class inherited from in the .cs file. A
component is inherited from System.ComponentModel.Component.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 17 '05 #4
I compare the code to another form and its the same. The code for
System.ComponetModel.Component is set to Null, just like my other forms.

private System.ComponentModel.Container components = null;
Here is all the code of the form. I replaced the password for security.

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;

namespace LicenseDealerSales
{
/// <summary>
/// Summary description for frmDealerSearch.
/// </summary>
///
public class frmDealerSearch : System.Windows.Forms.Form
{
private System.Windows.Forms.Button cmdOk;
private System.Windows.Forms.Button cmdCancel;
private System.Windows.Forms.DataGrid dgDealerInfo;

/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;

public frmDealerSearch()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form 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()
{
System.Resources.ResourceManager resources = new
System.Resources.ResourceManager(typeof(frmDealerS earch));
this.cmdOk = new System.Windows.Forms.Button();
this.cmdCancel = new System.Windows.Forms.Button();
this.dgDealerInfo = new System.Windows.Forms.DataGrid();
((System.ComponentModel.ISupportInitialize)(this.d gDealerInfo)).BeginInit();
this.SuspendLayout();
//
// cmdOk
//
this.cmdOk.Location = new System.Drawing.Point(152, 152);
this.cmdOk.Name = "cmdOk";
this.cmdOk.Size = new System.Drawing.Size(112, 40);
this.cmdOk.TabIndex = 1;
this.cmdOk.Text = "&OK";
this.cmdOk.Click += new System.EventHandler(this.cmdOk_Click);
//
// cmdCancel
//
this.cmdCancel.Location = new System.Drawing.Point(336, 152);
this.cmdCancel.Name = "cmdCancel";
this.cmdCancel.Size = new System.Drawing.Size(112, 40);
this.cmdCancel.TabIndex = 2;
this.cmdCancel.Text = "&Cancel";
this.cmdCancel.Click += new System.EventHandler(this.cmdCancel_Click);
//
// dgDealerInfo
//
this.dgDealerInfo.Anchor =
((System.Windows.Forms.AnchorStyles)((((System.Win dows.Forms.AnchorStyles.Top
| System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgDealerInfo.DataMember = "";
this.dgDealerInfo.HeaderForeColor =
System.Drawing.SystemColors.ControlText;
this.dgDealerInfo.Location = new System.Drawing.Point(16, 16);
this.dgDealerInfo.Name = "dgDealerInfo";
this.dgDealerInfo.ReadOnly = true;
this.dgDealerInfo.Size = new System.Drawing.Size(576, 112);
this.dgDealerInfo.TabIndex = 0;
//
// frmDealerSearch
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 13);
this.BackColor = System.Drawing.Color.LightSteelBlue;
this.ClientSize = new System.Drawing.Size(610, 216);
this.ControlBox = false;
this.Controls.Add(this.cmdOk);
this.Controls.Add(this.cmdCancel);
this.Controls.Add(this.dgDealerInfo);
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,
((System.Byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this. Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "frmDealerSearch";
this.Text = "Dealer Search";
this.Load += new System.EventHandler(this.frmDealerSearch_Load);
((System.ComponentModel.ISupportInitialize)(this.d gDealerInfo)).EndInit();
this.ResumeLayout(false);

}
#endregion

private void cmdCancel_Click(object sender, System.EventArgs e)
{
this.DialogResult = DialogResult.Cancel;

}

private void cmdOk_Click(object sender, System.EventArgs e)
{
frmDataEntry f = new frmDataEntry();
f.SetTextBox("Test");

this.DialogResult = DialogResult.OK;
}

private void frmDealerSearch_Load(object sender, System.EventArgs e)
{
string sConnString = "Data Source=db;Database=License;Integrated
Security=False;User ID=sa;password=password";
string sProc = "prGet_DealerInfo";

using (SqlConnection oCn = new SqlConnection(sConnString))
{
using (SqlCommand oCmd = new SqlCommand(sProc, oCn))
{
oCn.Open();
oCmd.CommandType = CommandType.StoredProcedure;

oCmd.Parameters.Add("@sDealerNum", SqlDbType.NChar, 6);
oCmd.Parameters["@sDealerNum"].Value = "101043";

SqlDataAdapter oDa = new SqlDataAdapter();

oDa.SelectCommand = oCmd;
DataSet ds=new DataSet();
oDa.Fill(ds);
DataGridTableStyle tableStyle = new DataGridTableStyle();
tableStyle.MappingName="DealerInfo";

int numCols = ds.Tables[0].Columns.Count;
DataGridNoActiveCellColumn aColumnTextColumn ;
for(int i = 0; i < numCols; ++i)
{
aColumnTextColumn = new DataGridNoActiveCellColumn();
aColumnTextColumn.HeaderText = ds.Tables[0].Columns[i].ColumnName;

aColumnTextColumn.MappingName = ds.Tables[0].Columns[i].ColumnName;
tableStyle.GridColumnStyles.Add(aColumnTextColumn) ;
}
dgDealerInfo.TableStyles.Clear();
tableStyle.MappingName=ds.Tables[0].TableName;
dgDealerInfo.TableStyles.Add(tableStyle);
dgDealerInfo.DataSource = ds.Tables[0];


}
}
}

}
public class DataGridNoActiveCellColumn : DataGridTextBoxColumn
{
private int SelectedRow = -1;
protected override void Edit(System.Windows.Forms.CurrencyManager source,
int rowNum, System.Drawing.Rectangle bounds, bool readOnly,string
instantText,bool cellIsVisible)
{
//make sure previous selection is valid
if(SelectedRow > -1 && SelectedRow < source.List.Count + 1)
this.DataGridTableStyle.DataGrid.UnSelect(Selected Row);
SelectedRow = rowNum;
this.DataGridTableStyle.DataGrid.Select(SelectedRo w);
}
}
}
"Kevin Yu [MSFT]" wrote:
Hi Cadel,

This icon is used when the file is a Component Class or a Windows Service.
Please check what class is this class inherited from in the .cs file. A
component is inherited from System.ComponentModel.Component.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 17 '05 #5
Hi Cadel,

Thanks for posting your code here. I tried your code on my machine, and I
was able to reproduce it.

Based on the code you have provided, I found that another class public
class DataGridNoActiveCellColumn : DataGridTextBoxColumn is defined in the
cs file. This is why the icon changed. VS.NET regard it as a component
because not only the form class is defined. This is by design. If you put
the public class DataGridNoActiveCellColumn : DataGridTextBoxColumn class
definition to another file, the icon changes back to form icon.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 17 '05 #6
Hi Cadel,

Thanks for posting your code here. I tried your code on my machine, and I
was able to reproduce it.

Based on the code you have provided, I found that another class public
class DataGridNoActiveCellColumn : DataGridTextBoxColumn is defined in the
cs file. This is why the icon changed. VS.NET regard it as a component
because not only the form class is defined. This is by design. If you put
the public class DataGridNoActiveCellColumn : DataGridTextBoxColumn class
definition to another file, the icon changes back to form icon.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: n3crius | last post by:
I've noticed that when I'm programming Windows applications in the .net sutdio I can't see an expansion option in the Solution Explorer to get the .cs behind the WindowsForm. In contrast, I can...
2
by: Julijan Sribar | last post by:
Hello, In my application I want to display same icons that are displayed in Solution Explorer. I know that these icons are in csproj.dll file (for C# projects), but Solution Explorer does not...
1
by: Max Khitrov | last post by:
Hello everyone, I'm working on a VS .NET add-in that will allow developers to use Subversion software from within the IDE (much like Source Safe). Ideally, I would like for my plug-in to be able...
4
by: Alpha | last post by:
I have a small Window application and through out the different forms I create a different dataset. At the begining I used the Tools to drag and drop the SqlDataAdapter, connection and dataset...
7
by: Larry Woods | last post by:
I don't see the pattern. I have a couple of solutions that I acquired from someone else. When I load these, I see the .vbproj and .vbproj.user files in the Solution Explorer. BUT, when I create...
6
by: I_AM_DON_AND_YOU? | last post by:
I have a small VB.Net Solution. The solution has filename LABELMAKER.SLN and the the project has filename LABELMAKER.VBPROJ. There is another file LABELMAKER.VBPROJ.USER. All these are in a...
2
by: Bruce Russell | last post by:
This may sound stupid but I can't rename the WebForm1.aspx in the solution explorer. The file is located in my local web server at C:\Inetpub\wwwroot\Lab3-VB-Starter\WebForm1.aspx Is there...
0
by: José Joye | last post by:
Hello, Is there a way within VS2005 to synchronize the Solution Explorer view and the file we are currently working on. Say I'm working on blabla.cs file which is located within the foo...
5
by: =?Utf-8?B?U2NhbmJveQ==?= | last post by:
Guyz, I want to remove items from the Solution Explorer. The VBE 2005 help system claims that to do this, you have to:- 1. Select the item you want to remove. 2. On the 'Edit' menu,...
3
by: Ryan Liu | last post by:
I was supervised that Vista is so difficult to use(e.g. search), lost so many good features (e.g. go upper level folder) and so unstable(even MS own programs will hang up, back to Windows 95/98...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.