示例#1
0
        //событие двойного клика по хедеру строки которое выводит картинку в новое окно
        //Double click event on the line header that displays the picture in a new window
        private void dataGridView1_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            // получаем индекс выбранного ряда
            //get the index of the selected row
            int ind = dataGridView1.CurrentRow.Index;
            //вытаскиваем имя файла выбранной строки
            //extract the file name of the selected line
            string name = (string)dataGridView1[0, ind].Value;
            string way_to_FILE;

            //находим через метод search путь к файлу и проверяем что путь существует
            //we find through the search method the path to the file and check that the path exists
            if ((way_to_FILE = NewLister.search(name)) != null)
            {
                //инициализируем новую форму, передаем ей параметром путь к фото которе надо вывести
                //initialize a new form, pass it to the parameter path to the photo which should be output
                full_size ob = new full_size(way_to_FILE);
                //выводим форму на экран
                //display the form on the screen
                ob.Show();
            }
            //если путя к фото нет
            //if there is no way to the photo
            else
            {
                //выводим данное сообщение
                //output this message
                MessageBox.Show("Ошибка при открытии фото!", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#2
0
        //событие двойного клика по хедеру строки которое выводит картинку в новое окно
        //Double click event on the line header that displays the picture in a new window
        private void dataGridView1_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            //получаем индекс выбранного ряда
            //get the index of the selected row
            int i = dataGridView1.CurrentRow.Index;
            //инициализируем новую форму, передаем ей параметром путь к фото которе надо вывести
            //initialize a new form, pass it a parameter to the path on the photo which should be output
            full_size ob = new full_size(lister.PATH_OF_PHOTO(i));

            //показываем форму
            //show the form
            ob.Show();
        }