Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

www.DRSTEIN99.com www.RAIDGEAR.net www.THERE.com -> Tell them DrStein99 sent ya!
  • *Experts*
Posted

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).

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

  • *Experts*
Posted

Ah, okay. Use the Return keyword to return the array from the function, instead of setting sbpGoal = nsPanel:

Return nsPanel

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...