Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 Microsoft.Office.Interop.Excel;
- using Excel = Microsoft.Office.Interop.Excel;
- namespace excel
- {
- public partial class Form1 : Form
- {
- string img = "C:\\Users\\Artem\\source\\repos\\excel\\images\\";
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- Excel excel = new Excel("C:\\Users\\Artem\\source\\repos\\excel\\excel.xlsx", 1);
- label6.Text = excel.ReadCell(0, 0);
- label7.Text = excel.ReadCell(4, 0);
- label8.Text = "An " + excel.ReadCell(4, 0).ToString() + " travels at " + excel.ReadCell(4, 2).ToString() + " so would complete the marathon.";
- int i = 4;
- foreach (Control lbl in groupBox1.Controls) {
- lbl.Text = excel.ReadCell(i, 0);
- i++;
- }
- pictureBox6.SizeMode = PictureBoxSizeMode.StretchImage;
- pictureBox6.Load(img + "f1-car.jpg");
- pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
- pictureBox1.Load(img + excel.ReadCell(4, 1).ToString());
- pictureBox2.SizeMode = PictureBoxSizeMode.StretchImage;
- pictureBox2.Load(img + excel.ReadCell(5, 1).ToString());
- pictureBox3.SizeMode = PictureBoxSizeMode.StretchImage;
- pictureBox3.Load(img + excel.ReadCell(6, 1).ToString());
- pictureBox4.SizeMode = PictureBoxSizeMode.StretchImage;
- pictureBox4.Load(img + excel.ReadCell(7, 1).ToString());
- pictureBox5.SizeMode = PictureBoxSizeMode.StretchImage;
- pictureBox5.Load(img + excel.ReadCell(8, 1).ToString());
- }
- private void pictureBox1_Click(object sender, EventArgs e)
- {
- if(radioButton1.Checked == true)
- {
- dfs
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement