Added even SingelClick event for checking list

This commit is contained in:
2019-01-07 23:35:35 +01:00
parent 7d7ec52023
commit e98a3bf3f5
4 changed files with 25 additions and 11 deletions

14
tomcatAnalys/ListItem.cs Normal file
View File

@ -0,0 +1,14 @@
namespace tomcatAnalys
{
public class ListItem
{
public string GarantiNr { get; set; }
public string GarantiJob { get; set; }
public string[] xmlRader { get; set; }
public override string ToString()
{
string returStr = $"Garanti: {GarantiNr} Jobnr: {GarantiJob} ex: {xmlRader[6].Substring(0, 50) + "..."}";
return returStr;
}
}
}

View File

@ -67,6 +67,7 @@
this.lbInstances.Size = new System.Drawing.Size(744, 407); this.lbInstances.Size = new System.Drawing.Size(744, 407);
this.lbInstances.Sorted = true; this.lbInstances.Sorted = true;
this.lbInstances.TabIndex = 2; this.lbInstances.TabIndex = 2;
this.lbInstances.Click += new System.EventHandler(this.lbInstances_Click);
this.lbInstances.DoubleClick += new System.EventHandler(this.lbInstances_DoubleClick); this.lbInstances.DoubleClick += new System.EventHandler(this.lbInstances_DoubleClick);
// //
// btnClose // btnClose

View File

@ -106,23 +106,21 @@ namespace tomcatAnalys
} }
private void lbInstances_DoubleClick(object sender, EventArgs e) private void lbInstances_DoubleClick(object sender, EventArgs e)
{
CheckClickedRow();
}
private void CheckClickedRow()
{ {
ListItem aktRad = (ListItem)lbInstances.Items[lbInstances.SelectedIndex]; ListItem aktRad = (ListItem)lbInstances.Items[lbInstances.SelectedIndex];
fileWindow.FileShowerFileName = aktRad.GarantiNr + "-" + aktRad.GarantiJob; fileWindow.FileShowerFileName = aktRad.GarantiNr + "-" + aktRad.GarantiJob;
fileWindow.FileShowerBox.Lines = aktRad.xmlRader; fileWindow.FileShowerBox.Lines = aktRad.xmlRader;
fileWindow.ShowDialog(); fileWindow.ShowDialog();
} }
}
public class ListItem private void lbInstances_Click(object sender, EventArgs e)
{ {
public string GarantiNr { get; set; } CheckClickedRow();
public string GarantiJob { get; set; }
public string[] xmlRader { get; set; }
public override string ToString()
{
string returStr = $"Garanti: {GarantiNr} Jobnr: {GarantiJob} ex: {xmlRader[6].Substring(0, 50) + "..."}";
return returStr;
} }
} }
} }

View File

@ -58,6 +58,7 @@
<Compile Include="frmStart.Designer.cs"> <Compile Include="frmStart.Designer.cs">
<DependentUpon>frmStart.cs</DependentUpon> <DependentUpon>frmStart.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="ListItem.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="frmFileShower.resx"> <EmbeddedResource Include="frmFileShower.resx">