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
Solved! Go to Solution.
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.
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.
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?
Create a User Control that you want.
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
myPanel.Anchor = CType(Windows.Forms.AnchorStyles.Bottom + _ Windows.Forms.AnchorStyles.Left + _ Windows.Forms.AnchorStyles.Right + _ Windows.Forms.AnchorStyles.Top, Windows.Forms.AnchorStyles)
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.
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.
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.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register