Added try to add images arrows..

This commit is contained in:
Janco Kock
2015-11-03 21:50:36 +01:00
parent 363b20778a
commit d0951b2362
7 changed files with 78 additions and 4 deletions
@@ -92,7 +92,7 @@
<DependentUpon>ClientApplicatie.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
@@ -121,6 +121,15 @@
<ItemGroup>
<None Include="Resources\flatbike.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\down.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\stay.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\up.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
@@ -12,6 +12,7 @@ namespace ErgometerApplication
{
public Label labelMetingCurrentValue;
public ProgressBar progressBarMeting;
public PictureBox rpmpicturebox;
public Label metingName;
private int min { get; set; }
@@ -58,6 +59,7 @@ namespace ErgometerApplication
this.progressBarMeting.Size = new System.Drawing.Size(183, 23);
this.progressBarMeting.TabIndex = 1;
this.progressBarMeting.Value = 0;
//
// labelMetingCurrentValue
//
@@ -69,6 +71,17 @@ namespace ErgometerApplication
this.labelMetingCurrentValue.Size = new System.Drawing.Size(57, 32);
this.labelMetingCurrentValue.TabIndex = 2;
this.labelMetingCurrentValue.Text = "0";
//rpm check
if (name == "RPM")
{
this.rpmpicturebox = new PictureBox();
this.rpmpicturebox.Location = new System.Drawing.Point(210, 32);
this.rpmpicturebox.Size = new System.Drawing.Size(57, 32);
this.rpmpicturebox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.rpmpicturebox.AutoSize = true;
this.rpmpicturebox.Name = "rpmbox";
}
}
public void setText(string text)
@@ -78,6 +91,24 @@ namespace ErgometerApplication
public void updateValue(int value)
{
if(name == "RPM")
{
if(value < 45)
{
this.rpmpicturebox.Image = Properties.Resources.up;
this.labelMetingCurrentValue.ForeColor = System.Drawing.Color.Red;
}
else if( value > 55)
{
this.labelMetingCurrentValue.ForeColor = System.Drawing.Color.Red;
this.rpmpicturebox.Image = Properties.Resources.down;
}
else
{
this.labelMetingCurrentValue.ForeColor = System.Drawing.Color.Green;
this.rpmpicturebox.Image = Properties.Resources.stay;
}
}
if (name == "Tijd")
{
this.labelMetingCurrentValue.Text = Helper.SecondsToTime(value);
@@ -10,8 +10,9 @@
namespace ErgometerApplication.Properties {
using System;
using System.Drawing;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@@ -27,7 +28,7 @@ namespace ErgometerApplication.Properties {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
@@ -69,5 +70,29 @@ namespace ErgometerApplication.Properties {
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap up
{
get
{
object obj = ResourceManager.GetObject("up", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap down
{
get
{
object obj = ResourceManager.GetObject("down", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap stay
{
get
{
object obj = ResourceManager.GetObject("stay", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}
@@ -118,7 +118,16 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="down" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="flatbike" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\flatbike.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="stay" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\stay.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="up" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Binary file not shown.

After

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 885 B