Initial commit
This commit is contained in:
547
Mip/frmPridatVyrobok.cs
Normal file
547
Mip/frmPridatVyrobok.cs
Normal file
@@ -0,0 +1,547 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
|
||||
|
||||
namespace Mip
|
||||
{
|
||||
public partial class frmPridatVyrobok : Form
|
||||
{
|
||||
DataTable pomocnaDT = new DataTable();
|
||||
Point poinPosition;
|
||||
bool deleteRow=false;
|
||||
Single z=1;
|
||||
int sizeH;
|
||||
int sizeW;
|
||||
|
||||
|
||||
public frmPridatVyrobok(string strZakaznik)
|
||||
{
|
||||
InitializeComponent();
|
||||
label2.Text = strZakaznik;
|
||||
|
||||
this.MouseWheel += new MouseEventHandler(pictureBox1_MouseWheel);
|
||||
|
||||
}
|
||||
|
||||
private void pictureBox1_MouseWheel(object sender, MouseEventArgs e)
|
||||
{
|
||||
|
||||
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
|
||||
z += (Convert.ToSingle(0.1) * (e.Delta / Math.Abs(e.Delta)));
|
||||
pictureBox1.Height = Convert.ToInt32(sizeH * z);
|
||||
pictureBox1.Width = Convert.ToInt32(sizeW * z);
|
||||
if (dataGridView1.RowCount != 0)
|
||||
{
|
||||
DataGridViewRow dtrw;
|
||||
dtrw = dataGridView1.CurrentRow;
|
||||
groupBox1.Text = "Zobraziť výkres: " + dtrw.Cells["Nazov_suboru"].Value.ToString() + ", " + "Zoom= " + (Convert.ToSingle(pictureBox1.Width) / Convert.ToSingle(pictureBox1.Image.Width)).ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void frmPridatVyrobok_Load(object sender, EventArgs e)
|
||||
{
|
||||
pomocnaDT.Columns.Add("Nazov_suboru",typeof (string));
|
||||
pomocnaDT.Columns.Add("Velkost_suboru",typeof (string));
|
||||
pomocnaDT.Columns.Add("Cesta",typeof (string));
|
||||
VypisSpojenyRozmer();
|
||||
classGlobal.FillCB(comboBox2, "tabpomocnychudajov", "Hodnota", "Kategoria", "Pridať iný názov");
|
||||
|
||||
}
|
||||
|
||||
private void btnAddVykres_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
openFileDialog1.Multiselect = true;
|
||||
openFileDialog1.DefaultExt = "jpg";
|
||||
openFileDialog1.FileName = "";
|
||||
openFileDialog1.ShowDialog();
|
||||
if (openFileDialog1.FileNames != null && openFileDialog1.FileName != "")
|
||||
{
|
||||
foreach (string FN in openFileDialog1.FileNames)
|
||||
{
|
||||
bool FNexist = false;
|
||||
foreach (DataRow rowCesta in pomocnaDT.Rows)
|
||||
{
|
||||
if (rowCesta["Cesta"].ToString() == FN.ToString()) FNexist = true;
|
||||
}
|
||||
|
||||
if (!FNexist)
|
||||
{
|
||||
FileStream fileStream;
|
||||
fileStream = new FileStream(FN, FileMode.Open, FileAccess.Read);
|
||||
char[] help = new char[FN.Length - FN.LastIndexOf("\\") - 1];
|
||||
|
||||
|
||||
FN.CopyTo(FN.LastIndexOf("\\") + 1, help, 0, (help.Length));
|
||||
string hlp = new string(help);
|
||||
pomocnaDT.Rows.Add(hlp, FN.Length.ToString(), FN);
|
||||
|
||||
dataGridView1.DataSource = pomocnaDT;
|
||||
dataGridView1.AutoResizeColumns();
|
||||
dataGridView1.AutoResizeRows();
|
||||
dataGridView1.Rows[dataGridView1.Rows.Count - 1].Selected = true;
|
||||
obrazok_Refresh(dataGridView1.Rows.Count - 1);
|
||||
if (dataGridView1.Rows.Count > 4) dataGridView1.FirstDisplayedScrollingRowIndex = dataGridView1.Rows.Count - 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Súbor: " + FN + "\n už v zozname figuruje!", "Upozornenie ...", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
//MessageBox.Show(
|
||||
|
||||
}
|
||||
|
||||
|
||||
pictureBox1.Visible = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (textBox6.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "" && dataGridView1.Rows.Count != 0) button5.Enabled = true;
|
||||
else button5.Enabled = false; //kontrola naplnenia povinných dát
|
||||
}
|
||||
|
||||
|
||||
private void btnVymazVykres_Click(object sender, EventArgs e)
|
||||
{
|
||||
deleteRow = true;
|
||||
int currentRowIndex = dataGridView1.CurrentRow.Index;
|
||||
pomocnaDT.Rows[currentRowIndex].Delete();
|
||||
if (pomocnaDT.Rows.Count == 0)
|
||||
{
|
||||
btnVymazVykres.Enabled = false;
|
||||
button5.Enabled = false;
|
||||
button1.Enabled = false;
|
||||
pictureBox1.Visible = false;
|
||||
}
|
||||
else //v tabulke ešte sú dáta
|
||||
{
|
||||
if (currentRowIndex > 0) currentRowIndex--;
|
||||
dataGridView1.Rows[currentRowIndex].Selected = true;
|
||||
obrazok_Refresh(currentRowIndex);
|
||||
pictureBox1.Visible = true;
|
||||
}
|
||||
if (textBox6.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "" && dataGridView1.Rows.Count !=0) button5.Enabled = true;
|
||||
else button5.Enabled = false; //kontrola naplnenia povinných dát
|
||||
}
|
||||
|
||||
private void pictureBox1_LocationChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//int p1=0;
|
||||
private void dataGridView1_RowEnter(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
//label1.Text = "teraz "+p1++.ToString();
|
||||
|
||||
btnVymazVykres.Enabled = true;
|
||||
button1.Enabled = true;
|
||||
if (textBox6.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "" && dataGridView1.Rows.Count != 0) button5.Enabled = true;
|
||||
else button5.Enabled = false; //kontrola naplnenia povinných dát
|
||||
|
||||
|
||||
|
||||
|
||||
if (!deleteRow) obrazok_Refresh(e.RowIndex);
|
||||
else deleteRow = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void obrazok_Refresh(int index)
|
||||
{
|
||||
|
||||
FileStream fs;
|
||||
int fileSize;
|
||||
byte[] fileData;
|
||||
DataRow dRow;
|
||||
|
||||
dRow = pomocnaDT.Rows[index];
|
||||
fs = new FileStream(dRow["Cesta"].ToString(), FileMode.Open, FileAccess.Read);
|
||||
fileSize = (int)fs.Length;
|
||||
fileData = new byte[fileSize];
|
||||
fs.Read(fileData, 0, fileSize);
|
||||
fs.Close();
|
||||
|
||||
Bitmap obrazok;
|
||||
//using (MemoryStream stream = new MemoryStream(fileData)) obrazok = new Bitmap(stream);
|
||||
MemoryStream stream = new MemoryStream(fileData);
|
||||
obrazok = new Bitmap(stream);
|
||||
pictureBox1.Image = obrazok;
|
||||
pictureBox1.Height = obrazok.Height;
|
||||
pictureBox1.Width = obrazok.Width;
|
||||
sizeH = pictureBox1.Image.Size.Height;
|
||||
sizeW = pictureBox1.Image.Size.Width;
|
||||
z = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void label9_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void Zavrieť_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void textBox2_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
VypisSpojenyRozmer();
|
||||
|
||||
if (textBox6.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "" && dataGridView1.Rows.Count != 0) button5.Enabled = true;
|
||||
else button5.Enabled = false; //kontrola naplnenia povinných dát
|
||||
}
|
||||
|
||||
public void VypisSpojenyRozmer()
|
||||
{
|
||||
string strSpojeny = "";
|
||||
string strKonZnak ="";
|
||||
|
||||
if (textBox2.Text != "")
|
||||
{
|
||||
if(textBox1.Text =="") strKonZnak = "";
|
||||
else strKonZnak = " -" + textBox1.Text ;
|
||||
|
||||
if (numericUpDown1.Value == 0)
|
||||
{
|
||||
if (textBox3.Text != "" && textBox3.Text != "0") strSpojeny = label10.Text + textBox2.Text + "/" + textBox3.Text + "x" + textBox4.Text + strKonZnak ;
|
||||
else strSpojeny = label10.Text + textBox2.Text + "x" + textBox4.Text + strKonZnak ;
|
||||
}
|
||||
else strSpojeny = label10.Text + textBox2.Text + "x" + textBox3.Text + "x" + textBox4.Text + strKonZnak ;
|
||||
}
|
||||
else strSpojeny = "";
|
||||
label12.Text = strSpojeny;
|
||||
}
|
||||
|
||||
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (numericUpDown1.Value == 0)
|
||||
{
|
||||
label10.Text = "Ø";
|
||||
label4.Text = "Ømax";
|
||||
label5.Text = "Ømin";
|
||||
label6.Text = "Dĺžka";
|
||||
}
|
||||
else
|
||||
{
|
||||
label10.Text = "□";
|
||||
label4.Text = "X";
|
||||
label5.Text = "Y";
|
||||
label6.Text = "Z";
|
||||
}
|
||||
VypisSpojenyRozmer();
|
||||
}
|
||||
|
||||
private void textBox3_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
VypisSpojenyRozmer();
|
||||
|
||||
if (textBox6.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "" && dataGridView1.Rows.Count != 0) button5.Enabled = true;
|
||||
else button5.Enabled = false; //kontrola naplnenia povinných dát
|
||||
}
|
||||
|
||||
private void textBox4_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
VypisSpojenyRozmer();
|
||||
|
||||
if (textBox6.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "" && dataGridView1.Rows.Count != 0) button5.Enabled = true;
|
||||
else button5.Enabled = false; //kontrola naplnenia povinných dát
|
||||
}
|
||||
private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
float floatResult;
|
||||
if (e.KeyChar == '.') e.KeyChar = ',';
|
||||
if (!(float.TryParse(textBox2.Text + e.KeyChar, out floatResult)) && (int)e.KeyChar != 8) e.KeyChar = '\0';
|
||||
}
|
||||
|
||||
private void textBox3_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
float floatResult;
|
||||
if (e.KeyChar == '.') e.KeyChar = ',';
|
||||
if (!(float.TryParse(textBox3.Text + e.KeyChar, out floatResult)) && (int)e.KeyChar != 8) e.KeyChar = '\0';
|
||||
}
|
||||
|
||||
private void textBox4_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
float floatResult;
|
||||
if (e.KeyChar == '.') e.KeyChar = ',';
|
||||
if (!(float.TryParse(textBox4.Text + e.KeyChar, out floatResult)) && (int)e.KeyChar != 8) e.KeyChar = '\0';
|
||||
}
|
||||
|
||||
private void textBox1_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
VypisSpojenyRozmer();
|
||||
}
|
||||
|
||||
private void pictureBox1_Click(object sender, EventArgs e)
|
||||
{
|
||||
textBox1.Focus();
|
||||
}
|
||||
|
||||
private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
poinPosition = e.Location;
|
||||
}
|
||||
}
|
||||
|
||||
private void groupBox1_Enter(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void dataGridView1_DataMemberChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void dataGridView1_CurrentCellChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void button5_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void dataGridView1_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
if (btnVymazVykres.Enabled && ((Keys)e.KeyChar == Keys.Delete || e.KeyChar == '-')) btnVymazVykres_Click(null, null);
|
||||
if (e.KeyChar == '+') btnAddVykres_Click(null, null);
|
||||
|
||||
}
|
||||
|
||||
private void frmPridatVyrobok_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
// dataGridView1_KeyPress(null, e);
|
||||
}
|
||||
|
||||
private void dataGridView1_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
|
||||
{
|
||||
btnVymazVykres_Click(null, null);
|
||||
}
|
||||
|
||||
private void button6_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void panel1_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void btnCopyToClipboard_Click(object sender, EventArgs e)
|
||||
{
|
||||
Clipboard.SetText(textBox5.Text);
|
||||
}
|
||||
|
||||
private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
Point changePoint = new Point (e.Location.X - poinPosition.X, e.Location.Y - poinPosition.Y);
|
||||
panel1.AutoScrollPosition = new Point(-panel1.AutoScrollPosition.X - changePoint.X, -panel1.AutoScrollPosition.Y - changePoint.Y);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void button6_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
|
||||
z += Convert.ToSingle(0.1);
|
||||
pictureBox1.Height = Convert.ToInt32(sizeH * z);
|
||||
pictureBox1.Width = Convert.ToInt32(sizeW * z);
|
||||
if (dataGridView1.RowCount != 0)
|
||||
{
|
||||
DataGridViewRow dtrw;
|
||||
dtrw = dataGridView1.CurrentRow;
|
||||
groupBox1.Text = "Zobraziť výkres: " + dtrw.Cells["Nazov_suboru"].Value.ToString() + ", " + "Zoom= " + (Convert.ToSingle(pictureBox1.Width) / Convert.ToSingle(pictureBox1.Image.Width)).ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void button7_Click(object sender, EventArgs e)
|
||||
{
|
||||
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
|
||||
z -= Convert.ToSingle(0.1);
|
||||
pictureBox1.Height = Convert.ToInt32(sizeH * z);
|
||||
pictureBox1.Width = Convert.ToInt32(sizeW * z);
|
||||
if (dataGridView1.RowCount != 0)
|
||||
{
|
||||
DataGridViewRow dtrw;
|
||||
dtrw = dataGridView1.CurrentRow;
|
||||
groupBox1.Text = "Zobraziť výkres: " + dtrw.Cells["Nazov_suboru"].Value.ToString() + ", " + "Zoom= " + (Convert.ToSingle(pictureBox1.Width) / Convert.ToSingle(pictureBox1.Image.Width)).ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
string nazov = dataGridView1.CurrentRow.Cells["Nazov_Suboru"].Value.ToString();
|
||||
char[] nnazov = new char[nazov.LastIndexOf(".")];
|
||||
|
||||
nazov.CopyTo(0, nnazov, 0, nnazov.Length);
|
||||
textBox6.Text = new string(nnazov);
|
||||
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
Form Add = new frmAddPomUdaje();
|
||||
Add.Text = "Pridať iný názov";
|
||||
DialogResult dr = Add.ShowDialog();
|
||||
if (dr == DialogResult.OK)
|
||||
{
|
||||
classGlobal.FillCB(comboBox2, "tabpomocnychudajov", "Hodnota", "Kategoria", "Pridať iný názov");
|
||||
comboBox2.Text = classGlobal.strNovyPomocnyUdaj;
|
||||
}
|
||||
}
|
||||
|
||||
private void button5_Click_1(object sender, EventArgs e)
|
||||
|
||||
{
|
||||
string cmd;
|
||||
DataTable dtbl = new DataTable();
|
||||
classSQL.SQL("SELECT `NazovVyrobku` FROM `mip`.`tabvyrobok` WHERE `Zakaznik`= '" + label2.Text
|
||||
+ "' AND `NazovVyrobku` = '" + textBox6.Text + "';", out dtbl);
|
||||
|
||||
if (dtbl.Rows.Count != 0) MessageBox.Show("Výrobok s názvom: \n " + textBox6.Text + "\n v datábáze výrobkov odberateľa " + label2.Text + " už existuje!!!\n Prosím zmeňte názov výrobku", "Pozor ... ",
|
||||
MessageBoxButtons.OK,MessageBoxIcon.Warning); //Ak sa výrobok v databaze uz nachádza
|
||||
else // ak sa výrobok v dtbaze nenachádza tak ho pridať
|
||||
{
|
||||
classGlobal.strNovyPomocnyUdaj = textBox6.Text; //pomocný údaj pre naplnenie comboboxu po zavreti okna
|
||||
string statusVyrobku = "";
|
||||
if (radioButton1.Checked == true) statusVyrobku = "Výroba";
|
||||
if (radioButton2.Checked == true) statusVyrobku = "Cenová ponuka";
|
||||
|
||||
if (textBox7.Text == "") textBox7.Text = "1"; // Ak je pocet segmentov "" tak potom je 1
|
||||
cmd = "INSERT INTO `mip`.`tabvyrobok` (`NazovVyrobku`, `RozmerTvar`, `Rozmer1`, `Rozmer2`, `Rozmer3`, `SpojeneRozmery`, `Zakaznik`, `InyNazov`, `RozlisZnakKonecnaOp`, `Alias`,`PocetSegmentov`, `Status výrobku`) VALUES ('"
|
||||
+ textBox6.Text.ToString() + "', '" //NazovVyrobku
|
||||
+ label10.Text.ToString() + "', " //RozmerTvar
|
||||
+ textBox2.Text.ToString().Replace(",",".") + ", " //rozmer1
|
||||
+ textBox3.Text.ToString().Replace(",", ".") + "," //rozmer2
|
||||
+ textBox4.Text.ToString().Replace(",", ".") + ", '" //rozmer3
|
||||
+ label12.Text.ToString() + "', '" //spojene rozmery
|
||||
+ label2.Text.ToString() + "', '" //zakaznik
|
||||
+ comboBox2.Text.ToString() + "', '" //Iny nazov
|
||||
+ textBox1.Text.ToString() + "', '" //rozlis znak alebo konecna operacia
|
||||
+ textBox5.Text.ToString() + "', " //alias
|
||||
+ textBox7.Text.ToString() + ", '"
|
||||
+ statusVyrobku + "');"; //Pocet segmetnov
|
||||
|
||||
classSQL.SQL(cmd);
|
||||
//dtbl=classSQL.commandSQL(cmd,1);
|
||||
|
||||
// <Pridať výkresovú dokumentáciu do tabvykresy>
|
||||
int IDVyrobok;
|
||||
//classSQL.commandSQL("SELECT `IDVyrobok` FROM `mip`.`tabvyrobok` WHERE `Zakaznik`= '" + label2.Text + "';");
|
||||
// IDVyrobok = (int)classSQL.dTable.Rows[0]["IDVyrobok"];
|
||||
|
||||
string ccmmdd = "SELECT `NazovVyrobku`,`IDVyrobok` FROM `mip`.`tabvyrobok` WHERE `Zakaznik`= '" + label2.Text
|
||||
+ "' AND `NazovVyrobku` = '" + textBox6.Text + "';";
|
||||
|
||||
classSQL.SQL(ccmmdd, out dtbl);
|
||||
DataRow dtrw = dtbl.Rows[0];
|
||||
IDVyrobok = Convert.ToInt32(dtrw["IDVyrobok"].ToString());
|
||||
|
||||
for (int p1=0; p1 < pomocnaDT.Rows.Count; p1++)
|
||||
{
|
||||
FileStream fs;
|
||||
int fileSize;
|
||||
byte[] VykresData;
|
||||
|
||||
dtrw=pomocnaDT.Rows[p1];
|
||||
fs = new FileStream(dtrw["Cesta"].ToString(), FileMode.Open, FileAccess.Read);
|
||||
fileSize = (int)fs.Length;
|
||||
VykresData = new byte[fileSize];
|
||||
fs.Read(VykresData, 0, fileSize);
|
||||
fs.Close();
|
||||
|
||||
classSQL.SaveVykresToSQL(IDVyrobok, p1 + 1, VykresData);
|
||||
}
|
||||
|
||||
MessageBox.Show("Výrobok úspešne pridaný!");
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
|
||||
// </Pridať výkresovú dokumentáciu do tabvykresy>
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void textBox6_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
if (textBox6.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "" && dataGridView1.Rows.Count != 0) button5.Enabled = true;
|
||||
else button5.Enabled = false; //kontrola naplnenia povinných dát
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void textBox6_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
/*
|
||||
|
||||
char[] invalidchars = Path.GetInvalidFileNameChars();
|
||||
|
||||
foreach (char znak in invalidchars)
|
||||
{
|
||||
if (e.KeyChar == znak) e.KeyChar = '\0';
|
||||
|
||||
*/
|
||||
|
||||
if((int)e.KeyChar!=8) foreach (char znak in Path.GetInvalidFileNameChars()) if (e.KeyChar == znak) e.KeyChar = '\0';
|
||||
|
||||
}
|
||||
|
||||
private void toolTip1_Popup(object sender, PopupEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void toolTip1_Draw(object sender, DrawToolTipEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void textBox7_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
int intResult;
|
||||
//if (e.KeyChar == '.') e.KeyChar = ',';
|
||||
if (!(int.TryParse(textBox7.Text + e.KeyChar, out intResult)) && (int)e.KeyChar != 8) e.KeyChar = '\0';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user