Professional Documents
Culture Documents
and design is your choice but u have to use these controls properly in some kind of logical
connection in working.
B]List view
CODE:
private void button2_Click(object sender, EventArgs e)
{
ListViewItem lvi = new ListViewItem(textBox1.Text);
lvi.SubItems.Add(textBox2.Text);
lvi.SubItems.Add(textBox3.Text);
listView1.Items.Add(lvi);
textBox1.Text =
""; textBox2.Text
= "";
textBox3.Text =
"";
}
C] Combox
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.Data.SqlClient;
namespace WindowsFormsApplication22
{
public partial class Add : Form
{
public Add()
{
InitializeComponent();
}
string lastDir;
string filenaem;
private void label7_Click(object sender, EventArgs e)
{
OpenFileDialog open = new OpenFileDialog();
open.Filter = "Image Files( *.png; *.jpg; *.bmp;)|*.png; *.jpg; *.bmp";
if (lastDir == null)
open.InitialDirectory = @"c:\";
else
open.InitialDirectory = lastDir;
if (open.ShowDialog() == DialogResult.OK)
{
filenaem = System.IO.Path.GetFullPath(open.FileName);
lastDir = open.FileName;
label7.Text = lastDir;
pictureBox1.Image = new Bitmap(open.FileName);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
}
}
try
{
int n;
n = cmd.ExecuteNonQuery();
if (n > 0)
MessageBox.Show("Record stored successfully");
else
MessageBox.Show("Error");
}
catch (SqlException ex)
{
MessageBox.Show(ex.Message);
}
}
}
}
}