예제 #1
0
        void ReleaseDesignerOutlets()
        {
            if (BigLabel != null)
            {
                BigLabel.Dispose();
                BigLabel = null;
            }

            if (MenuTableView != null)
            {
                MenuTableView.Dispose();
                MenuTableView = null;
            }

            if (ProfileImage != null)
            {
                ProfileImage.Dispose();
                ProfileImage = null;
            }

            if (SmallLabel != null)
            {
                SmallLabel.Dispose();
                SmallLabel = null;
            }
        }
예제 #2
0
파일: EditorBase.cs 프로젝트: zBart/Ares
        private void Editor_SizeChanged(object sender, EventArgs e)
        {
            System.Drawing.Font font = BigLabel.Font;
            String text = BigLabel.Text;

            using (System.Drawing.Graphics g = BigLabel.CreateGraphics())
            {
                float textWidth = g.MeasureString(text, font).Width;
                if (textWidth == 0)
                {
                    return;
                }
                float factor = BigLabel.Width / textWidth;
                if (factor == 0)
                {
                    return;
                }
                BigLabel.Font = new System.Drawing.Font(font.Name, font.SizeInPoints * factor);
            }
        }