Click here to Skip to main content
15,898,371 members
Home / Discussions / C#
   

C#

 
GeneralRe: Casting generic lists Pin
Not Active24-Oct-06 3:07
mentorNot Active24-Oct-06 3:07 
GeneralRe: Casting generic lists Pin
Ed.Poore24-Oct-06 3:47
Ed.Poore24-Oct-06 3:47 
GeneralRe: Casting generic lists Pin
Daniel Grunwald24-Oct-06 5:21
Daniel Grunwald24-Oct-06 5:21 
GeneralRe: Casting generic lists Pin
Ed.Poore24-Oct-06 5:36
Ed.Poore24-Oct-06 5:36 
QuestionNewbie: Porblem with ListView... Pin
Phillip Hodges24-Oct-06 0:10
Phillip Hodges24-Oct-06 0:10 
AnswerRe: Newbie: Porblem with ListView... Pin
baerten24-Oct-06 2:34
baerten24-Oct-06 2:34 
GeneralRe: Newbie: Porblem with ListView... Pin
Phillip Hodges24-Oct-06 22:03
Phillip Hodges24-Oct-06 22:03 
GeneralRe: Newbie: Porblem with ListView... Pin
baerten25-Oct-06 0:07
baerten25-Oct-06 0:07 
namespace codepro
{
///
/// Zusammenfassung für Form1.
///

public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.ListView TheList;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.Button button1;
///
/// Erforderliche Designervariable.
///

private System.ComponentModel.Container components = null;

public Form1()
{
//
// Erforderlich für die Windows Form-Designerunterstützung
//
InitializeComponent();

//
// TODO: Fügen Sie den Konstruktorcode nach dem Aufruf von InitializeComponent hinzu
//
}

///
/// Die verwendeten Ressourcen bereinigen.
///

protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Vom Windows Form-Designer generierter Code
///
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
///

private void InitializeComponent()
{
System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem(new string[] {
"One",
"1.2.",
"1.3.",
"1.4."}, -1);
System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem(new string[] {
"Two",
"2.1.",
"2.2.",
"2.3."}, -1);
System.Windows.Forms.ListViewItem listViewItem3 = new System.Windows.Forms.ListViewItem(new string[] {
"Four",
"4.1.",
"4.2.",
"4.3."}, -1);
this.TheList = new System.Windows.Forms.ListView();
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// TheList
//
this.TheList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2});
this.TheList.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
listViewItem1,
listViewItem2,
listViewItem3});
this.TheList.Location = new System.Drawing.Point(24, 16);
this.TheList.Name = "TheList";
this.TheList.Size = new System.Drawing.Size(200, 232);
this.TheList.TabIndex = 0;
this.TheList.View = System.Windows.Forms.View.List;
this.TheList.SelectedIndexChanged += new System.EventHandler(this.TheList_SelectedIndexChanged);
//
// columnHeader1
//
this.columnHeader1.Text = ":: 1 ::";
//
// columnHeader2
//
this.columnHeader2.Text = ":: 2 ::";
//
// button1
//
this.button1.Location = new System.Drawing.Point(240, 80);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(48, 64);
this.button1.TabIndex = 1;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.button1);
this.Controls.Add(this.TheList);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);

}
#endregion

///
/// Der Haupteinstiegspunkt für die Anwendung.
///

[STAThread]
static void Main()
{
Application.Run(new Form1());
}

private void TheList_SelectedIndexChanged(object sender, System.EventArgs e)
{

}

private void button1_Click(object sender, System.EventArgs e)
{
System.Windows.Forms.ListViewItem listViewItemIns = new System.Windows.Forms.ListViewItem(new string[] {
"Three",
"3.1.",
"3.2.",
"3.3."}, -1);
TheList.Items.Insert(2,listViewItemIns);
Refresh();
}
}
}

The button1_Click inserts the Item "Three" at the correct place

So i doesn't see a mistake in you code Sigh | :sigh:
QuestionDate Of Birth Pin
bhanu1234523-Oct-06 23:33
bhanu1234523-Oct-06 23:33 
AnswerRe: Date Of Birth Pin
Jon Hulatt23-Oct-06 23:48
Jon Hulatt23-Oct-06 23:48 
AnswerRe: Date Of Birth Pin
V.24-Oct-06 0:43
professionalV.24-Oct-06 0:43 
AnswerRe: Date Of Birth Pin
Ed.Poore24-Oct-06 1:02
Ed.Poore24-Oct-06 1:02 
AnswerRe: Date Of Birth Pin
Guffa24-Oct-06 1:02
Guffa24-Oct-06 1:02 
AnswerRe: Date Of Birth Pin
Drew McGhie25-Oct-06 11:57
Drew McGhie25-Oct-06 11:57 
QuestionButton with Transparancy Pin
Jon Hulatt23-Oct-06 23:32
Jon Hulatt23-Oct-06 23:32 
AnswerRe: Button with Transparancy Pin
Dave Kreskowiak24-Oct-06 5:31
mveDave Kreskowiak24-Oct-06 5:31 
QuestionSql Server Express Edition Configuration with C# Pin
fahiemulleh23-Oct-06 23:25
fahiemulleh23-Oct-06 23:25 
AnswerRe: Sql Server Express Edition Configuration with C# Pin
fahiemulleh24-Oct-06 8:30
fahiemulleh24-Oct-06 8:30 
QuestionPlease help. MessageBox.Show(this, "hello") pops up behind my mainform Pin
bradsnobar23-Oct-06 21:07
bradsnobar23-Oct-06 21:07 
AnswerRe: Please help. MessageBox.Show(this, "hello") pops up behind my mainform Pin
Martin#23-Oct-06 21:26
Martin#23-Oct-06 21:26 
GeneralRe: Please help. MessageBox.Show(this, "hello") pops up behind my mainform Pin
bradsnobar24-Oct-06 6:41
bradsnobar24-Oct-06 6:41 
AnswerRe: Please help. MessageBox.Show(this, "hello") pops up behind my mainform Pin
V.23-Oct-06 21:26
professionalV.23-Oct-06 21:26 
GeneralRe: Please help. MessageBox.Show(this, "hello") pops up behind my mainform Pin
bradsnobar24-Oct-06 6:42
bradsnobar24-Oct-06 6:42 
QuestionHow to invoke an event using reflection? Pin
Super Lloyd23-Oct-06 20:56
Super Lloyd23-Oct-06 20:56 
AnswerRe: How to invoke an event using reflection? Pin
Stefan Troschuetz23-Oct-06 21:27
Stefan Troschuetz23-Oct-06 21:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.