-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForm2.cs
More file actions
72 lines (60 loc) · 2.17 KB
/
Copy pathForm2.cs
File metadata and controls
72 lines (60 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace MyExcel
{
public partial class Form2 : Form
{
public List<string> listaFunkcija = new List<string>();
public List<string> opisiFunkcija = new List<string>();
public MyExcel.Form1 excel;
DataGridViewCell odabrana;
bool okPressed = false;
public Form2()
{
InitializeComponent();
listBox1.SelectedIndexChanged += new EventHandler(listBox1_SelectedIndexChanged);
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (excel.fje.opisi.Count > listBox1.SelectedIndex && listBox1.SelectedIndex != -1)
{
label4.Text = excel.fje.opisi[listBox1.SelectedItem.ToString().ToLower()];
string t = "= " + listBox1.SelectedItem.ToString().ToUpper() + "( )";
textBox1.Text = t;
}
//textBox1.Select(1,5);
}
private void button1_Click(object sender, EventArgs e)
{
excel.celijaIzForme = odabrana;
excel.toolStripTextBox1.Text = textBox1.Text;
excel.toolStripButton1_Click(null, null);
excel.toolStripTextBox1.Clear();
okPressed = true;
Close();
}
private void button2_Click(object sender, EventArgs e)
{
excel.otvorenaFormula = false;
Close();
}
private void Form2_FormClosed(object sender, FormClosedEventArgs e)
{
excel.otvorenIzbor = false;
if (!okPressed)
excel.otvorenaFormula = false;
}
private void Form2_Load(object sender, EventArgs e)
{
odabrana = excel.tGrid.SelectedCells[0];
foreach (KeyValuePair<string, string> f in excel.fje.opisi)
listBox1.Items.Add(f.Key.ToUpper());
}
}
}