Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //events
- public new event EventHandler Click
- {
- add { picbox.Click += value; }
- remove { picbox.Click -= value; }
- }
- public Form1()
- {
- InitializeComponent();
- foreach (Control c in this.Controls)
- {
- TP1CustomListView ctLV = c as TP1CustomListView;
- if (ctLV != null)
- {
- ctLV.Click += ctLV_Click;
- }
- }
- }
- void ctLV_Click(object sender, EventArgs e)
- {
- TP1CustomListView customView = sender as TP1CustomListView;
- if(customView!=null)
- {
- MessageBox.Show(customView.subtbTitle.Text + customView.subtbContent.Text + customView.subtbFooter.Text);
- }
- }
- //sub controls
- public PictureBox subPicbox;
- public TextBox subtbTitle;
- public TextBox subtbContent;
- public TextBox subtbFooter;
- public TP1CustomListView()
- {
- InitializeComponent();
- subtbTitle = txtTitle;
- subtbContent = txtContent;
- subtbFooter = txtFooter;
- subPicbox = picbox;
- tableLayoutPanel1.Dock = DockStyle.Fill;
- }
Add Comment
Please, Sign In to add comment