1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-08 02:34:06 +02:00

Add RichTextLabel control

This commit is contained in:
chylex 2016-04-09 17:19:09 +02:00
parent 99baa53d33
commit 8961421d92
3 changed files with 73 additions and 0 deletions

41
Core/RichTextLabel.Designer.cs generated Normal file
View File

@ -0,0 +1,41 @@
namespace TweetDick.Core {
partial class RichTextLabel {
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.SuspendLayout();
//
// RichTextLabel
//
this.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.ReadOnly = true;
this.TabStop = false;
this.MouseEnter += new System.EventHandler(this.RichTextLabel_MouseEnter);
this.ResumeLayout(false);
}
#endregion
}
}

26
Core/RichTextLabel.cs Normal file
View File

@ -0,0 +1,26 @@
using System;
using System.Windows.Forms;
namespace TweetDick.Core{
public partial class RichTextLabel : RichTextBox{
public RichTextLabel(){
InitializeComponent();
SetStyle(ControlStyles.Selectable,false);
SetStyle(ControlStyles.UserMouse,true);
SetStyle(ControlStyles.SupportsTransparentBackColor,true);
}
private void RichTextLabel_MouseEnter(object sender, EventArgs e){
Cursor = Cursors.Default;
}
protected override void WndProc(ref Message m){
if (m.Msg == 0x204 || m.Msg == 0x205){ // WM_RBUTTONDOWN, WM_RBUTTONUP
return;
}
base.WndProc(ref m);
}
}
}

View File

@ -84,6 +84,12 @@
<Compile Include="Core\FormBrowser.Designer.cs">
<DependentUpon>FormBrowser.cs</DependentUpon>
</Compile>
<Compile Include="Core\RichTextLabel.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Core\RichTextLabel.Designer.cs">
<DependentUpon>RichTextLabel.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<None Include="Configuration\app.config" />