示例#1
0
		public InfoPanel() {
			content = new Scintilla();
			ScintillaHack.Apply(content);

			content.BorderStyle = BorderStyle.None;
			content.Folding.IsEnabled = false;
			foreach (var i in content.Margins)
				i.Width = 0;

			content.BackColor = BackColor = Color.FromArgb(0xff, 0xff, 0xe1);

			content.Styles[1].Font = Font; // Header
			content.Styles[1].Size = 10;
			content.Styles[1].BackColor = BackColor;
			content.Styles[1].ForeColor = Color.FromArgb(0x00, 0x00, 0x00);

			content.Styles[2].Font = Font; // Name
			content.Styles[2].Size = 9;
			content.Styles[2].BackColor = BackColor;
			content.Styles[2].ForeColor = Color.FromArgb(0x00, 0x00, 0x00);
			content.Styles[2].Bold = true;

			content.Styles[3].Font = Font; // Value
			content.Styles[3].Size = 9;
			content.Styles[3].BackColor = BackColor;
			content.Styles[3].ForeColor = Color.FromArgb(0x00, 0x00, 0x00);

			content.Scrolling.HorizontalScrollTracking = true;

			content.Selection.BackColorUnfocused = content.Selection.BackColor;
			content.Selection.ForeColorUnfocused = content.Selection.ForeColor;

			const uint SCI_SETEXTRAASCENT = 2525;
			const uint SCI_SETEXTRADESCENT = 2527;
			content.NativeInterface.SendMessageDirect(SCI_SETEXTRAASCENT, 2);
			content.NativeInterface.SendMessageDirect(SCI_SETEXTRADESCENT, 3);

			content.IsReadOnly = true;

			Controls.Add(content);

			Width = Height = 100;
			content.SetBounds(0, 0, Width, Height);
			content.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right;
		}