using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Sterring
{
public partial class Horizontal : UserControl
{
public Horizontal()
{
InitializeComponent();
}
private void Horizontal_Load(object sender, EventArgs e)
{
}
int value = 0;
int dead = 5;
[Browsable(true), Category("My")]
public int Value
{
get { return value; }
set { this.value = value; }
}
[Browsable(true), Category("My")]
public int Dead
{
get { return dead; }
set { dead = value; }
}
[Browsable(true), Category("My")]
public event EventHandler EndChange;
bool change = false;
Point start;
private void lbl_value_MouseDown(object sender, MouseEventArgs e)
{
change = true;
}
private void lbl_value_MouseUp(object sender, MouseEventArgs e)
{
change = false;
if (EndChange != null)
{
EventArgs ea = new EventArgs();
EndChange(this, ea);
}
}
private void lbl_value_MouseMove(object sender, MouseEventArgs e)
{
if (change)
{
int x = lbl_value.Location.X + e.X - start.X;
if (x < 0) x = 0;
if (x > Width - lbl_value.Width) x = Width - lbl_value.Width;
lbl_value.Location = new Point(x, lbl_value.Location.Y);
value = (int)(100 - 200 * (lbl_value.Location.X / ((float)Width - lbl_value.Width)));
if (value > -dead & value < dead) value = 0; //TT: & &&;
if (value > 0) lbl_value.Text = string.Format("{0%}", value);
else
{
lbl_value.Text = string.Format("{0%}", -value);
}
}
}
}
}
Witam mam następujący problem otóż pisze na zaliczenie symulator morski i w linijcje
else
{
lbl_value.Text = string.Format("{0%}", -value);
}
pojawia mi się błąd Nieprawidłowy format ciągu wejściowego i nie wiem jak to naprawić czy ktoś mógłby mi wyjaśnic co robie żle