Click here to Skip to main content
16,005,149 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Convert from decimal to hexidecimal? Pin
DaveAuld30-Apr-10 4:28
professionalDaveAuld30-Apr-10 4:28 
GeneralRe: Convert from decimal to hexidecimal? Pin
Adam Wike1-May-10 13:32
Adam Wike1-May-10 13:32 
QuestionDynamically adding tool strip buttons [modified] Pin
MacRaider430-Apr-10 2:54
MacRaider430-Apr-10 2:54 
AnswerRe: Dynamically adding tool strip buttons Pin
Simon_Whale30-Apr-10 3:17
Simon_Whale30-Apr-10 3:17 
GeneralRe: Dynamically adding tool strip buttons Pin
MacRaider430-Apr-10 3:39
MacRaider430-Apr-10 3:39 
GeneralRe: Dynamically adding tool strip buttons Pin
MacRaider430-Apr-10 3:49
MacRaider430-Apr-10 3:49 
AnswerRe: Dynamically adding tool strip buttons Pin
Wayne Gaylard30-Apr-10 3:56
professionalWayne Gaylard30-Apr-10 3:56 
GeneralRe: Dynamically adding tool strip buttons Pin
MacRaider430-Apr-10 6:44
MacRaider430-Apr-10 6:44 
Ok so this is now working great, and I really do appreciate the help. Of three forums this is the only one I've gotten a response on.
Now I've been trying to figure out how to get this to work with a module. The "buttons" need to be available to different forms in the project thus the reason for adding them at run time.
I've tried:
ToolStrip1.Items.Add(Call Buttons(btnSomething2))
as I have used Call 'sub in the module'('variable') in the past and it has worked. Though when I try it in this respect I get "Expression Expected" where Call is.

This is the Module I created:
Module ToolStripBtns

    Sub Buttons()

        Dim btnSomething As New ToolStripButton
        btnSomething.Text = "Test 1"
        btnSomething.Image = Image.FromFile("F:\VisualBasic\ToolStripTest\images\eventlog.ico")
        btnSomething.TextImageRelation = TextImageRelation.ImageAboveText
        btnSomething.ToolTipText = "This is Just a Test"
        AddHandler btnSomething.Click, AddressOf btnSomething_Click

    End Sub

    Private Sub btnSomething_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

        MsgBox(CType(sender, ToolStripButton).ToolTipText & ", " & CType(sender, ToolStripButton).Text)

    End Sub

End Module


I trimmed out some of the "junk" to make it shorter...

Thank you again!
GeneralRe: Dynamically adding tool strip buttons Pin
Wayne Gaylard30-Apr-10 15:11
professionalWayne Gaylard30-Apr-10 15:11 
GeneralRe: Dynamically adding tool strip buttons Pin
MacRaider43-May-10 6:30
MacRaider43-May-10 6:30 
QuestionRead data from MS Excel Pin
nishkarsh_k30-Apr-10 2:18
nishkarsh_k30-Apr-10 2:18 
AnswerRe: Read data from MS Excel Pin
Dave Kreskowiak30-Apr-10 4:01
mveDave Kreskowiak30-Apr-10 4:01 
GeneralRe: Read data from MS Excel [modified] Pin
nishkarsh_k3-May-10 2:25
nishkarsh_k3-May-10 2:25 
GeneralRe: Read data from MS Excel Pin
Dave Kreskowiak3-May-10 5:09
mveDave Kreskowiak3-May-10 5:09 
AnswerRe: Read data from MS Excel Pin
Wayne Gaylard30-Apr-10 4:05
professionalWayne Gaylard30-Apr-10 4:05 
GeneralRe: Read data from MS Excel Pin
nishkarsh_k2-May-10 20:28
nishkarsh_k2-May-10 20:28 
GeneralRe: Read data from MS Excel [modified] Pin
nishkarsh_k2-May-10 23:37
nishkarsh_k2-May-10 23:37 
GeneralRe: Read data from MS Excel Pin
Wayne Gaylard3-May-10 0:07
professionalWayne Gaylard3-May-10 0:07 
GeneralRe: Read data from MS Excel Pin
nishkarsh_k3-May-10 2:08
nishkarsh_k3-May-10 2:08 
GeneralRe: Read data from MS Excel Pin
nishkarsh_k4-May-10 3:27
nishkarsh_k4-May-10 3:27 
GeneralRe: Read data from MS Excel Pin
Wayne Gaylard4-May-10 20:44
professionalWayne Gaylard4-May-10 20:44 
GeneralRe: Read data from MS Excel Pin
nishkarsh_k5-May-10 0:28
nishkarsh_k5-May-10 0:28 
GeneralRe: Read data from MS Excel Pin
Wayne Gaylard5-May-10 1:41
professionalWayne Gaylard5-May-10 1:41 
GeneralRe: Read data from MS Excel Pin
nishkarsh_k6-May-10 19:53
nishkarsh_k6-May-10 19:53 
GeneralRe: Read data from MS Excel Pin
nishkarsh_k16-May-10 4:11
nishkarsh_k16-May-10 4:11 

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.