1 // Copyright (C) 2019 Kazuhiro Fujieda <fujieda@users.osdn.me>
\r
3 // Licensed under the Apache License, Version 2.0 (the "License");
\r
4 // you may not use this file except in compliance with the License.
\r
5 // You may obtain a copy of the License at
\r
7 // http://www.apache.org/licenses/LICENSE-2.0
\r
9 // Unless required by applicable law or agreed to in writing, software
\r
10 // distributed under the License is distributed on an "AS IS" BASIS,
\r
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
12 // See the License for the specific language governing permissions and
\r
13 // limitations under the License.
\r
16 using System.ComponentModel;
\r
17 using System.Drawing;
\r
18 using System.Windows.Forms;
\r
20 namespace KancolleSniffer.View
\r
22 [DesignerCategory("Code")]
\r
23 public class GrowLeftLabel : Label
\r
25 private int _right = int.MinValue;
\r
27 private bool _growLeft;
\r
29 public bool GrowLeft
\r
40 public GrowLeftLabel()
\r
42 UseMnemonic = false;
\r
45 protected override void OnSizeChanged(EventArgs args)
\r
47 base.OnSizeChanged(args);
\r
51 protected override void OnLayout(LayoutEventArgs args)
\r
53 base.OnLayout(args);
\r
57 private void AdjustLocation()
\r
61 if (_right == int.MinValue || _left != Left)
\r
67 if (_right == Right)
\r
69 _left -= Right - _right;
\r
70 Location = new Point(_left, Top);
\r