Loading...
Searching...
No Matches
CutWidthsControl.cs
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Drawing;
5using System.Data;
6using System.Linq;
7using System.Text;
8using System.Windows.Forms;
9
10namespace CutStockGUI
11{
12 public partial class CutWidthsControl : UserControl
13 {
14
15 private void maxWidth_ValueChanged(object sender, EventArgs e)
16 {
17 trackBar.Maximum = (int)((NumericUpDown)sender).Value;
18 label.Text = trackBar.Value.ToString();
19 }
20
21 public CutWidthsControl(string name, int width, int maxWidth, int demand, Color color, NumericUpDown nudMaxWidth)
22 {
23 InitializeComponent();
24 label1.Text = name;
25 this.Name = name;
26 trackBar.Maximum = maxWidth;
27 trackBar.Value = width;
28 nud.Value = demand;
29 this.BackColor = color;
30 nudMaxWidth.ValueChanged += new System.EventHandler(maxWidth_ValueChanged);
31 }
32
33 private void trackBar_ValueChanged(object sender, EventArgs e)
34 {
35 TrackBar tb = ((TrackBar)sender);
36 this.label.Text = tb.Value.ToString();
37 }
38
39 public int WidthValue
40 {
41 get { return trackBar.Value; }
42 }
43
44 public int DemandValue
45 {
46 get { return (int) nud.Value; }
47 }
48 }
49}