.NET

Reply
Valued Contributor
RPeter
Posts: 89
Registered: ‎01-09-2009
Message 1 of 9 (369 Views)
Accepted Solution

Scrollbars in custom toolpalette

369 Views, 8 Replies
03-12-2013 07:06 AM

I've created a custom toolpaletteset based on a user control named uc_Gewicht, however I don't know/can't access the scrollbars?

 

Imports System.Runtime
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.Internal

Public Class cls_Commando
    Friend Shared m_ps As Autodesk.AutoCAD.Windows.PaletteSet = Nothing
    <CommandMethod("MASSABEPALING")> Public Sub MassaBepaling()
        If m_ps = Nothing Then
            m_ps = New Autodesk.AutoCAD.Windows.PaletteSet("Massabepaling MM")
            m_ps.Add("Massabepaling MM", New uc_Gewicht)
        End If
        m_ps.Visible = True
    End Sub
End Class

 Regards

 

Peter

I don't think there are scroll bars in a palette.

Add your controls into a panel and then add the panel to palette.

Set your anchor points

Then set Panel's AutoScroll to true.

*Expert Elite*
arcticad
Posts: 1,285
Registered: ‎06-21-2004
Message 2 of 9 (360 Views)

Re: Scrollbars in custom toolpalette

03-12-2013 07:34 AM in reply to: RPeter

I don't think there are scroll bars in a palette.

Add your controls into a panel and then add the panel to palette.

Set your anchor points

Then set Panel's AutoScroll to true.

---------------------------



(defun botsbuildbots() (botsbuildbots))
Valued Contributor
RPeter
Posts: 89
Registered: ‎01-09-2009
Message 3 of 9 (337 Views)

Re: Scrollbars in custom toolpalette

03-12-2013 11:29 PM in reply to: arcticad

Thanks for your reply, now I get the vertical scrollbars. At the moment I haven't got the horizontal scrollbars. But I think I can manage to get them now.

 

Thanks!

Valued Contributor
andred
Posts: 88
Registered: ‎10-17-2003
Message 4 of 9 (277 Views)

Re: Scrollbars in custom toolpalette

06-04-2013 10:19 AM in reply to: arcticad

Hello,

 

I think I don't understand how to do that. I add a panel in my user control and put all my controls in that panel. I adjust the Autoscroll property to True on my panel but I don't see any difference.

 

I know you write "Add you controls into a panel and add the panel to palette" but I don't know how to create a panel and attach a user control by code  (maybe I have to create a user form???) and add it to the palette???? actually I add my userControl.

 

And what are the anchor points???

 

Do you have code sample?

 

Regards,

 

André

 

Valued Contributor
RPeter
Posts: 89
Registered: ‎01-09-2009
Message 5 of 9 (250 Views)

Re: Scrollbars in custom toolpalette

06-05-2013 05:18 AM in reply to: RPeter

Step 1.

Create a User Control that you want.

 

Step 2.

Create a User Control that wraps the Control made in step 1.

You kan add it with the handler mybase.load

Private Sub uc_Step_2_load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
	Me.Controls.Add(New uc_Step_1)
End Sub

 

 In command you will create a palleteset to uc_Step_2 (the wrapper), make sure you've set the AutoScroll to True.

Public Class cls_Commando
    Friend Shared m_ps As Autodesk.AutoCAD.Windows.PaletteSet = Nothing

    <CommandMethod("MYPS")> Public Sub MYPS()
        If m_ps = Nothing Then
            m_ps = New Autodesk.AutoCAD.Windows.PaletteSet("My Custom PS")
            m_ps.KeepFocus = True
            m_ps.Add("My Custom PS", New uc_Step_2)
        End If
        m_ps.Visible = True
    End Sub
End Class

 

Regards

 

Peter

 

 

 

 

*Expert Elite*
arcticad
Posts: 1,285
Registered: ‎06-21-2004
Message 6 of 9 (245 Views)

Re: Scrollbars in custom toolpalette

06-05-2013 06:15 AM in reply to: RPeter
 myPanel.Anchor = CType(Windows.Forms.AnchorStyles.Bottom + _
                                         Windows.Forms.AnchorStyles.Left + _
                                         Windows.Forms.AnchorStyles.Right + _
                                         Windows.Forms.AnchorStyles.Top, Windows.Forms.AnchorStyles)

 

---------------------------



(defun botsbuildbots() (botsbuildbots))
Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 7 of 9 (233 Views)

Re: Scrollbars in custom toolpalette

06-05-2013 10:34 PM in reply to: arcticad

arcticad wrote:
 myPanel.Anchor = CType(Windows.Forms.AnchorStyles.Bottom + _
                                         Windows.Forms.AnchorStyles.Left + _
                                         Windows.Forms.AnchorStyles.Right + _
                                         Windows.Forms.AnchorStyles.Top, Windows.Forms.AnchorStyles)

 


Except that you don't use the addition (+) operator, you use the bitwise Or operator.

 

 

 

 

Valued Contributor
andred
Posts: 88
Registered: ‎10-17-2003
Message 8 of 9 (214 Views)

Re: Scrollbars in custom toolpalette

06-06-2013 05:52 AM in reply to: RPeter

Sorry guys,

 

I'm not able to figure it. The only way I found to have a scrolling bar is to set the AutoScroll property of the control itself to True. But it doesn't work as AutoCAD native palette, the scrolling bar is at the right and doesn't have the same appearance.

 

I attached a project sample. I add directly the user control to the user control wrapper inside a panel but each time I run the project, I had to change manually the reference to my user control, After loading the project hou have to type ShowTestPalette.

 

If you can help.

 

Regards

 

André

 

*Expert Elite*
arcticad
Posts: 1,285
Registered: ‎06-21-2004
Message 9 of 9 (207 Views)

Re: Scrollbars in custom toolpalette

06-06-2013 06:28 AM in reply to: andred

here you go.

 

And strangly + works, but you should use OR.

 

if you dock the panel you don't need to worry about it anyways.

 

---------------------------



(defun botsbuildbots() (botsbuildbots))
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.