Drstein99 Posted February 20, 2004 Posted February 20, 2004 Can someone help with my code please? I'm trying to add 3 statusbar panels at a time: StatusBar1.Panels.AddRange(sbpGoal(etest.code)) Here's the function that will add them: Private Function sbpGoal(ByVal pCode As String) As StatusBarPanel() Dim nsPanel(3) As StatusBarPanel Dim nsPanel1 As New StatusBarPanel Dim nsPanel2 As New StatusBarPanel Dim nsPanel3 As New StatusBarPanel nsPanel1.AutoSize = StatusBarPanelAutoSize.Contents nsPanel2.AutoSize = StatusBarPanelAutoSize.Contents nsPanel3.AutoSize = StatusBarPanelAutoSize.Contents nsPanel1.Text = "Goal Sales test1" nsPanel2.Text = "Goal Conv: test2" nsPanel3.Text = "Goal Cont/H: test3" nsPanel(0) = nsPanel1 nsPanel(1) = nsPanel2 nsPanel(2) = nsPanel3 'sbpGoal.Icon sbpGoal = nsPanel End Function Quote www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
*Experts* Bucky Posted February 20, 2004 *Experts* Posted February 20, 2004 What is the problem you are having? I can spot one error with the code: nsPanel() should be declared as nsPanel(2), which will set its length to 3 (items 0, 1, and 2). Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Drstein99 Posted February 20, 2004 Author Posted February 20, 2004 ok. somehow the panel array is "nothing" when it's retured to the function that adds to the status bar for some reason. Quote www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
*Experts* Bucky Posted February 20, 2004 *Experts* Posted February 20, 2004 Ah, okay. Use the Return keyword to return the array from the function, instead of setting sbpGoal = nsPanel: Return nsPanel Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Drstein99 Posted February 20, 2004 Author Posted February 20, 2004 looks like that did the trick thanks. Quote www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.