Click here to Skip to main content
15,896,348 members
Home / Discussions / C#
   

C#

 
AnswerRe: Programmatically get conditional compilation symbols? Pin
PIEBALDconsult21-Jan-09 5:41
mvePIEBALDconsult21-Jan-09 5:41 
QuestionNew to Custom Controls - Question Pin
Programm3r20-Jan-09 23:12
Programm3r20-Jan-09 23:12 
AnswerRe: New to Custom Controls - Question Pin
Rob Philpott20-Jan-09 23:37
Rob Philpott20-Jan-09 23:37 
GeneralRe: New to Custom Controls - Question Pin
Programm3r21-Jan-09 0:59
Programm3r21-Jan-09 0:59 
AnswerRe: New to Custom Controls - Question Pin
DaveyM6920-Jan-09 23:47
professionalDaveyM6920-Jan-09 23:47 
GeneralRe: New to Custom Controls - Question Pin
Programm3r21-Jan-09 1:00
Programm3r21-Jan-09 1:00 
QuestionRe: New to Custom Controls - Question Pin
Programm3r21-Jan-09 2:00
Programm3r21-Jan-09 2:00 
AnswerRe: New to Custom Controls - Question Pin
DaveyM6921-Jan-09 3:17
professionalDaveyM6921-Jan-09 3:17 
This would be better if the event were passed to the form that has the toolstrip. 2 Options:

1. Make the button public public ToolStripButton button1; then it can be accessed in the form
myToolStrip1.button1.Click += new EventHandler(button1_Click);

2. Better I think, raise your own ButtonClick event.
public event EventHandler ButtonClick;
ToolStripButton button1;

public MyToolStrip2()
{
    InitializeComponent();
}
private void InitializeComponent()
{
    button1 = new ToolStripButton();
    button1.Click += new EventHandler(button1_Click);
    button1.Text = "Open another Form";
    Items.Add(button1);
}

void button1_Click(object sender, EventArgs e)
{
    EventHandler eh = ButtonClick;
    if (eh != null)
        eh(sender, e);
}
then access the ButtonClick event of your toolstrip in the normal way
myToolStrip1.ButtonClick += new EventHandler(myToolStrip1_ButtonClick);

Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

GeneralRe: New to Custom Controls - Question Pin
Programm3r21-Jan-09 3:44
Programm3r21-Jan-09 3:44 
GeneralRe: New to Custom Controls - Question Pin
DaveyM6921-Jan-09 3:54
professionalDaveyM6921-Jan-09 3:54 
AnswerRe: New to Custom Controls - Question Pin
Thomas Stockwell21-Jan-09 5:37
professionalThomas Stockwell21-Jan-09 5:37 
QuestionC# audio conferencing Pin
Phan7om20-Jan-09 22:59
Phan7om20-Jan-09 22:59 
AnswerRe: C# audio conferencing Pin
Nagy Vilmos20-Jan-09 23:18
professionalNagy Vilmos20-Jan-09 23:18 
GeneralRe: C# audio conferencing Pin
musefan20-Jan-09 23:21
musefan20-Jan-09 23:21 
GeneralRe: C# audio conferencing Pin
Nagy Vilmos20-Jan-09 23:29
professionalNagy Vilmos20-Jan-09 23:29 
GeneralRe: C# audio conferencing Pin
Pete O'Hanlon20-Jan-09 23:55
mvePete O'Hanlon20-Jan-09 23:55 
GeneralRe: C# audio conferencing Pin
musefan21-Jan-09 0:37
musefan21-Jan-09 0:37 
GeneralRe: C# audio conferencing Pin
Christian Graus21-Jan-09 1:14
protectorChristian Graus21-Jan-09 1:14 
GeneralRe: C# audio conferencing Pin
Nagy Vilmos21-Jan-09 1:41
professionalNagy Vilmos21-Jan-09 1:41 
GeneralRe: C# audio conferencing Pin
musefan21-Jan-09 2:21
musefan21-Jan-09 2:21 
GeneralRe: C# audio conferencing Pin
Nagy Vilmos21-Jan-09 1:33
professionalNagy Vilmos21-Jan-09 1:33 
GeneralRe: C# audio conferencing Pin
musefan21-Jan-09 2:25
musefan21-Jan-09 2:25 
GeneralRe: C# audio conferencing Pin
Nagy Vilmos21-Jan-09 2:33
professionalNagy Vilmos21-Jan-09 2:33 
GeneralRe: C# audio conferencing Pin
Unsy21-Jan-09 4:18
Unsy21-Jan-09 4:18 
GeneralRe: C# audio conferencing Pin
musefan21-Jan-09 4:33
musefan21-Jan-09 4:33 

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.