mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-10-01 09:39:06 +13:00
39 lines
No EOL
1.3 KiB
C#
39 lines
No EOL
1.3 KiB
C#
// <copyright file="ScrollbarControlDesigner.cs" company="PlaceholderCompany">
|
|
// Copyright (c) PlaceholderCompany. All rights reserved.
|
|
// </copyright>
|
|
|
|
namespace SystemTrayMenu.UserInterface
|
|
{
|
|
using System;
|
|
using System.ComponentModel;
|
|
using System.Diagnostics;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
using System.Windows.Forms.Design;
|
|
|
|
internal class ScrollbarControlDesigner : ControlDesigner
|
|
{
|
|
public override SelectionRules SelectionRules
|
|
{
|
|
get
|
|
{
|
|
SelectionRules selectionRules = base.SelectionRules;
|
|
PropertyDescriptor propDescriptor = TypeDescriptor.GetProperties(Component)["AutoSize"];
|
|
if (propDescriptor != null)
|
|
{
|
|
bool autoSize = (bool)propDescriptor.GetValue(Component);
|
|
if (autoSize)
|
|
{
|
|
selectionRules = SelectionRules.Visible | SelectionRules.Moveable | SelectionRules.BottomSizeable | SelectionRules.TopSizeable;
|
|
}
|
|
else
|
|
{
|
|
selectionRules = SelectionRules.Visible | SelectionRules.AllSizeable | SelectionRules.Moveable;
|
|
}
|
|
}
|
|
|
|
return selectionRules;
|
|
}
|
|
}
|
|
}
|
|
} |