Click here to Skip to main content
15,889,116 members
Home / Discussions / C#
   

C#

 
QuestionCustom user control Pin
Jon Henry2-Aug-09 1:45
Jon Henry2-Aug-09 1:45 
AnswerRe: Custom user control Pin
Super Lloyd2-Aug-09 2:38
Super Lloyd2-Aug-09 2:38 
GeneralRe: Custom user control Pin
Jon Henry2-Aug-09 2:46
Jon Henry2-Aug-09 2:46 
GeneralRe: Custom user control Pin
Super Lloyd2-Aug-09 2:54
Super Lloyd2-Aug-09 2:54 
GeneralRe: Custom user control Pin
Super Lloyd2-Aug-09 3:16
Super Lloyd2-Aug-09 3:16 
GeneralRe: Custom user control Pin
Jon Henry2-Aug-09 3:23
Jon Henry2-Aug-09 3:23 
GeneralRe: Custom user control Pin
Super Lloyd2-Aug-09 4:05
Super Lloyd2-Aug-09 4:05 
GeneralRe: Custom user control Pin
Jon Henry2-Aug-09 4:25
Jon Henry2-Aug-09 4:25 
Here is my code. Im using visual studio. I added the button and two labels in the designer.

public partial class btnPlacard : UserControl
    {
        int height, width;

        public btnPlacard()
        {
            InitializeComponent();
        }

        public string text1
        {
            get { return lbl1.Text; }
            set { lbl1.Text = value; }
        }

        public string text2
        {
            get { return lbl2.Text; }
            set { lbl2.Text = value; }
        }

        public string tag1
        {
            get { return lbl1.Tag.ToString(); }
            set { lbl1.Tag = value; }
        }

        public string tag2
        {
            get { return lbl2.Tag.ToString(); }
            set { lbl2.Tag = value; }
        }

        public int labelHeight
        {
            set
            {
                height = value;
                lbl1.Size = new Size(btn.Size.Width, (int)(value * .45));
                lbl2.Size = new Size(btn.Size.Width, (int)(value * .40));
            }
        }

        public int labelWidth
        {
            set
            {
                width = value;
                lbl1.Size = new Size(value, (int)(height * .45));
                lbl2.Size = new Size(value, (int)(height * .40));
            }
        }

        public int font1
        {
            set { lbl1.Font = new Font("Microsoft Sans Serif", value, FontStyle.Bold); }
        }

        public int font2
        {
            set { lbl2.Font = new Font("Microsoft Sans Serif", value, FontStyle.Bold); }
        }

        private void lbl1_Click(object sender, EventArgs e)
        {
            lbl1.Click += new System.EventHandler(PassThrough_Click);
        }

        private void lbl2_Click(object sender, EventArgs e)
        {
            lbl2.Click += new System.EventHandler(PassThrough_Click);
        }

        private void PassThrough_Click(object sender, EventArgs e)
        {
            base.OnClick(e);
        }

        public void relocate()
        {
            lbl1.Location = new Point(0, (int)(height * .15));
            lbl2.Location = new Point(0, (int)(height * .52));
        }
    }

QuestionLooking for a control Pin
reilak2-Aug-09 0:05
reilak2-Aug-09 0:05 
AnswerRe: Looking for a control Pin
0x3c02-Aug-09 0:43
0x3c02-Aug-09 0:43 
GeneralRe: Looking for a control Pin
reilak2-Aug-09 20:48
reilak2-Aug-09 20:48 
Generalanother way to work with this control? [modified] Pin
reilak2-Aug-09 23:00
reilak2-Aug-09 23:00 
GeneralRe: another way to work with this control? Pin
0x3c03-Aug-09 3:04
0x3c03-Aug-09 3:04 
QuestionWindow Coordinates?? Pin
Muammar©1-Aug-09 23:58
Muammar©1-Aug-09 23:58 
AnswerRe: Window Coordinates?? Pin
dan!sh 2-Aug-09 0:10
professional dan!sh 2-Aug-09 0:10 
GeneralRe: Window Coordinates?? Pin
Muammar©2-Aug-09 7:52
Muammar©2-Aug-09 7:52 
QuestionCall method in parent aspx page from user control Pin
Chazzysb1-Aug-09 23:04
Chazzysb1-Aug-09 23:04 
AnswerRe: Call method in parent aspx page from user control [ ASP.NET Question ] Pin
Abhijit Jana1-Aug-09 23:42
professionalAbhijit Jana1-Aug-09 23:42 
AnswerRe: Call method in parent aspx page from user control Pin
dan!sh 1-Aug-09 23:54
professional dan!sh 1-Aug-09 23:54 
GeneralRe: Call method in parent aspx page from user control Pin
Chazzysb2-Aug-09 0:37
Chazzysb2-Aug-09 0:37 
GeneralRe: Call method in parent aspx page from user control [modified] Pin
Chazzysb2-Aug-09 2:31
Chazzysb2-Aug-09 2:31 
QuestionHow do I check whether a user is in an Active Directory group when given its username and password Pin
Andrew_1-Aug-09 21:32
Andrew_1-Aug-09 21:32 
AnswerRe: How do I check whether a user is in an Active Directory group when given its username and password Pin
Abhijit Jana1-Aug-09 21:56
professionalAbhijit Jana1-Aug-09 21:56 
GeneralRe: How do I check whether a user is in an Active Directory group when given its username and password Pin
Andrew_1-Aug-09 22:13
Andrew_1-Aug-09 22:13 
GeneraliGrid Pin
CoderForEver1-Aug-09 20:35
CoderForEver1-Aug-09 20:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.