本文整理汇总了C#中System.Windows.Forms.RichTextBox类的典型用法代码示例。如果您正苦于以下问题:C# RichTextBox类的具体用法?C# RichTextBox怎么用?C# RichTextBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RichTextBox类属于System.Windows.Forms命名空间,在下文中一共展示了RichTextBox类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: HighlightText
/// <summary>
/// Highlight all words that matches.
/// </summary>
/// <param name="myRtb">Source text box</param>
/// <param name="word">Word to match.</param>
public void HighlightText(RichTextBox myRtb, string word)
{
myRtb.SelectAll();
myRtb.SelectionBackColor = Color.White;
myRtb.SelectionColor = Color.Black;
myRtb.DeselectAll();
if (word == "")
{
return;
}
int s_start = myRtb.SelectionStart, startIndex = 0, index;
while ((index = myRtb.Text.IndexOf(word, startIndex)) != -1)
{
myRtb.Select(index, word.Length);
myRtb.SelectionColor = Color.White;
myRtb.SelectionBackColor = Color.Green;
startIndex = index + word.Length;
}
myRtb.SelectionStart = s_start;
myRtb.SelectionLength = 0;
myRtb.SelectionColor = Color.Black;
myRtb.SelectionBackColor = Color.White;
}
开发者ID:Caresilabs,项目名称:MAH_MultiThreading,代码行数:33,代码来源:Form1.cs
示例2: SpellViewInfo
public static void SpellViewInfo(DataRow spellInfo, RichTextBox _rtSpellInfo)
{
_rtSpellInfo.SelectionColor = Color.Blue;
_rtSpellInfo.AppendText(ViewTextInfo(spellInfo));
_rtSpellInfo.SelectionColor = Color.Black;
_rtSpellInfo.AppendText(ViewAttribute(spellInfo));
_rtSpellInfo.AppendText(ViewMask(spellInfo));
_rtSpellInfo.AppendText(ViewProcFlag(spellInfo));
_rtSpellInfo.AppendText(ViewFlags(spellInfo));
_rtSpellInfo.AppendText(ViewSpellFields(spellInfo, typeof(SpellFieldBloc1)));
_rtSpellInfo.AppendText(ViewSpellFields(spellInfo, typeof(SpellFieldBloc2)));
_rtSpellInfo.AppendText(ViewSpellFields(spellInfo, typeof(SpellFieldBloc3)));
_rtSpellInfo.AppendText(ViewInfoFromOtherTable(spellInfo));
_rtSpellInfo.AppendText(ViewReagent(spellInfo));
_rtSpellInfo.AppendText(ViewSpellFields(spellInfo, typeof(SpellFields2), 2));
_rtSpellInfo.AppendText(ViewSpellFields(spellInfo, typeof(SpellFields3), 3));
_rtSpellInfo.AppendText(ViewSpellItemInfo(spellInfo));
}
开发者ID:Derass,项目名称:spellwork,代码行数:29,代码来源:SpellInfo.cs
示例3: setFontStyle
private void setFontStyle(RichTextBox rtb, FontStyle style)
{
if (rtb.SelectionLength == 0)
setCharFontStyle(rtb, style);
else
{
// to avoid screen refreshing, we create a fake RichTextBox
using (RichTextBox a = new RichTextBox())
{
a.SuspendLayout();
a.SelectedRtf = rtb.SelectedRtf;
a.SelectAll();
int selectionStart = a.SelectionStart;
int selectionLength = a.SelectionLength;
int selectionEnd = selectionStart + selectionLength;
for (int x = selectionStart; x < selectionEnd; ++x)
{
// Set temporary selection
a.Select(x, 1);
// Toggle font style of the selection
setCharFontStyle(a, style);
}
// Restore the original selection
a.SelectAll();
rtb.SelectedRtf = a.SelectedRtf;
}
}
}
开发者ID:divyang4481,项目名称:lextudio,代码行数:28,代码来源:FontStyleAction.cs
示例4: InitializeComponent
/// <summary>
/// Méthode requise pour la prise en charge du concepteur - ne modifiez pas
/// le contenu de cette méthode avec l'éditeur de code.
/// </summary>
private void InitializeComponent()
{
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.SuspendLayout();
//
// richTextBox1
//
this.richTextBox1.Location = new System.Drawing.Point(0, 0);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(768, 512);
this.richTextBox1.TabIndex = 0;
this.richTextBox1.Text = "";
//
// Form1
//
this.ClientSize = new System.Drawing.Size(770, 514);
this.Controls.Add(this.richTextBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "How to use MediaInfo.Dll";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
开发者ID:bedashii,项目名称:ReturnMedz,代码行数:29,代码来源:HowToUse_Dll.cs
示例5: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.richTextBox = new System.Windows.Forms.RichTextBox();
this.run = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// richTextBox
//
this.richTextBox.Location = new System.Drawing.Point(8, 8);
this.richTextBox.Name = "richTextBox";
this.richTextBox.Size = new System.Drawing.Size(272, 216);
this.richTextBox.TabIndex = 0;
this.richTextBox.Text = "";
//
// run
//
this.run.Location = new System.Drawing.Point(16, 232);
this.run.Name = "run";
this.run.TabIndex = 1;
this.run.Text = "Run";
this.run.Click += new System.EventHandler(this.run_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.run,
this.richTextBox});
this.Name = "Form1";
this.Text = "Operators";
this.ResumeLayout(false);
}
开发者ID:juangdiaz,项目名称:NYU-CourseWork,代码行数:37,代码来源:Form1.cs
示例6: createAttachmentsForRemoteSupport
public static List<String> createAttachmentsForRemoteSupport(RichTextBox logViewContentsToSend, PictureBox screenShotToSend)
{
String sFile_LogViews = PublicDI.config.TempFileNameInTempDirectory + "_" + PublicDI.sDefaultFileName_ReportBug_LogView;
String sFile_LogViewsTxt = PublicDI.config.TempFileNameInTempDirectory + "_" + PublicDI.sDefaultFileName_ReportBug_LogView + ".txt";
String sFile_ScreenShot = PublicDI.config.TempFileNameInTempDirectory + "_" + PublicDI.sDefaultFileName_ReportBug_ScreenShotImage + ".Jpeg";
return Main_WinForms.createAttachmentsForRemoteSupport(logViewContentsToSend, screenShotToSend, sFile_LogViews, sFile_LogViewsTxt, sFile_ScreenShot);
}
开发者ID:sempf,项目名称:FluentSharp,代码行数:7,代码来源:DebugMsg.cs
示例7: Init
public void Init()
{
textBox = new RichTextBox();
textBox.Multiline = true;
textBoxWriter = new TextBoxWriter( textBox );
textBox.CreateControl();
}
开发者ID:taoxiease,项目名称:asegrp,代码行数:7,代码来源:TextBoxWriterTests.cs
示例8: AddText
private void AddText(RichTextBox RTB, string msg)
{
if (RTB.InvokeRequired)
RTB.Invoke(new Action(() => RTB.AppendText(msg)));
else
RTB.AppendText(msg);
}
开发者ID:DatKami,项目名称:FEAT,代码行数:7,代码来源:Form1.cs
示例9: Paint
public void Paint(int StartLine, int FinalLine, RichTextBox RTB)
{
if(StartLine < 0 || FinalLine < 0)
{
Console.WriteLine("错误:着色起始或终止行号 < 0");
return;
}
int OriSelectionStart = RTB.SelectionStart; //记录光标位置
RTB.SelectionChanged -= new System.EventHandler(mainform.richTextBox1_SelectionChanged);//注销选区改变事件,以免处理过程中多次触发、
RTB.TextChanged -= new System.EventHandler(mainform.richTextBox1_TextChanged); //注销文字改变事件
SendMessage(RTB.Handle, 0x0B, 0, 0); //第一轮加工开始,禁止组件重画,避免闪烁问题
RTB.SelectAll();
RTB.SelectionFont = Defines.TextBoxFont;
RTB.DeselectAll();
RTB.SelectionStart = OriSelectionStart;
SendMessage(RTB.Handle, 0x0B, 1, 0); //第一轮加工结束,允许组件重画
RTB.Refresh(); //组件刷新
SendMessage(RTB.Handle, 0x0B, 0, 0); //第二轮加工开始,禁止组件重画,避免着色闪烁问题
if (RTB.Lines.Length > 0 )
{
for (int i = StartLine; i <= FinalLine; i++) this.PaintLine(i, ref RTB); //对每行着色
}
RTB.SelectionLength = 0;
RTB.SelectionStart = OriSelectionStart; //光标归位
RTB.SelectionColor = Color.Black;
SendMessage(RTB.Handle, 0x0B, 1, 0); //第二轮加工结束,允许组件重画
RTB.TextChanged += new System.EventHandler(mainform.richTextBox1_TextChanged); //恢复事件
RTB.SelectionChanged += new System.EventHandler(mainform.richTextBox1_SelectionChanged); //恢复事件
RTB.Refresh();
}
开发者ID:jingjiajie,项目名称:SmartEditor,代码行数:31,代码来源:Painter.cs
示例10: AddToRTB
public static void AddToRTB(RichTextBox rtb, string strText, StyleType style, enumIcon icon)
{
switch (style)
{
case StyleType.bodyBlack:
AddToRTB(rtb, strText, Color.Black, 8, false, icon);
break;
case StyleType.bodyBlackBold:
AddToRTB(rtb, strText, Color.Black, 8, true, icon);
break;
case StyleType.bodyBlue:
AddToRTB(rtb, strText, Color.Blue, 8, false, icon);
break;
case StyleType.bodyBlueBold:
AddToRTB(rtb, strText, Color.Blue, 8, true, icon);
break;
case StyleType.bodyChocolate:
AddToRTB(rtb, strText, Color.Chocolate, 8, false, icon);
break;
case StyleType.bodyChocolateBold:
AddToRTB(rtb, strText, Color.Chocolate, 8, true, icon);
break;
case StyleType.bodyDarkGray:
AddToRTB(rtb, strText, Color.DarkGray, 8, false, icon);
break;
case StyleType.bodyMidnightBlue:
AddToRTB(rtb, strText, Color.MidnightBlue, 8, false, icon);
break;
case StyleType.bodyOrange:
AddToRTB(rtb, strText, Color.Orange, 8, false, icon);
break;
case StyleType.bodyPurple:
AddToRTB(rtb, strText, Color.Purple, 8, false, icon);
break;
case StyleType.bodyRed:
AddToRTB(rtb, strText, Color.Red, 8, false, icon);
break;
case StyleType.bodySeaGreen:
AddToRTB(rtb, strText, Color.SeaGreen, 8, false, icon);
break;
case StyleType.bodySeaGreenBold:
AddToRTB(rtb, strText, Color.SeaGreen, 8, true, icon);
break;
case StyleType.titleBlack:
AddToRTB(rtb, strText, Color.Black, 14, true, icon);
break;
case StyleType.titleBlue:
AddToRTB(rtb, strText, Color.Blue, 14, true, icon);
break;
case StyleType.titleChocolate:
AddToRTB(rtb, strText, Color.Chocolate, 14, true, icon);
break;
case StyleType.titleSeagreen:
AddToRTB(rtb, strText, Color.SeaGreen, 14, true, icon);
break;
default:
AddToRTB(rtb, strText, Color.Black, 8, false, icon);
break;
}
}
开发者ID:iasanders,项目名称:sushi,代码行数:60,代码来源:SmartStepsUtil.cs
示例11: Sequence
public Sequence(NpgsqlConnection conn,RichTextBox t)
{
InitializeComponent();
this.conn = conn;
this.t = t;
comboBox1.Items.Add("CACHE");
comboBox1.Items.Add("NO CACHE");
PC = new Postgres_Connection();
richTextBox1.StyleResetDefault();
richTextBox1.Styles[Style.Default].Font = "Consolas";
richTextBox1.Styles[Style.Default].Size = 10;
richTextBox1.StyleClearAll();
richTextBox1.Styles[Style.Cpp.Default].ForeColor = Color.Silver;
richTextBox1.Styles[Style.Cpp.Comment].ForeColor = Color.FromArgb(0, 128, 0); // Green
richTextBox1.Styles[Style.Cpp.CommentLine].ForeColor = Color.FromArgb(0, 128, 0); // Green
richTextBox1.Styles[Style.Cpp.CommentLineDoc].ForeColor = Color.FromArgb(128, 128, 128); // Gray
richTextBox1.Styles[Style.Cpp.Number].ForeColor = Color.Red;
richTextBox1.Styles[Style.Cpp.Word].ForeColor = Color.Blue;
richTextBox1.Styles[Style.Cpp.Word2].ForeColor = Color.Fuchsia;
richTextBox1.Styles[Style.Cpp.String].ForeColor = Color.FromArgb(163, 21, 21); // Red
richTextBox1.Styles[Style.Cpp.Character].ForeColor = Color.FromArgb(163, 21, 21); // Red
richTextBox1.Styles[Style.Cpp.Verbatim].ForeColor = Color.FromArgb(163, 21, 21); // Red
richTextBox1.Styles[Style.Cpp.Operator].ForeColor = Color.Silver;
richTextBox1.Styles[Style.Cpp.Preprocessor].ForeColor = Color.Purple;
richTextBox1.Lexer = Lexer.Cpp;
richTextBox1.Margins[0].Width = 16;
//richTextBox1.SetKeywords(0, "abort absolute access action add admin after aggregate all also alter always analyse analyze and any array as asc assertion assignment asymmetric at attribute authorization backward before begin between bigint binary bit boolean both by cache called cascade cascaded case cast catalog chain char character characteristics check checkpoint class close cluster coalesce collate collation column comment comments commit committed concurrently configuration connection constraint constraints content continue conversion copy cost create cross csv current current_catalog current_date current_role current_schema current_time current_timestamp current_user cursor cycle data database day deallocate dec decimal declare default defaults deferrable deferred definer delete delimiter delimiters desc dictionary disable discard distinct do document domain double drop each else enable encoding encrypted end enum escape event except exclude excluding exclusive execute exists explain extension external extract false family fetch filter first float following for force foreign forward freeze from full function functions global grant granted greatest group handler having header hold hour identity if ilike immediate immutable implicit in including increment index indexes inherit inherits initially inline inner inout input insensitive insert instead int integer intersect interval into invoker is isnull isolation join key label language large last lateral lc_collate lc_ctype leading leakproof least left level like limit listen load local localtime localtimestamp location lock mapping match materialized maxvalue minute minvalue mode month move name names national natural nchar next no none not nothing notify notnull nowait null nullif nulls numeric object of off offset oids on only operator option options or order ordinality out outer over overlaps overlay owned owner parser partial partition passing password placing plans position preceding precision prepare prepared preserve primary prior privileges procedural procedure program quote range read real reassign recheck recursive ref references refresh reindex relative release rename repeatable replace replica reset restart restrict returning returns revoke right role rollback row rows rule savepoint schema scroll search second security select sequence sequences serializable server session session_user set setof share show similar simple smallint snapshot some stable standalone start statement statistics stdin stdout storage strict strip substring symmetric sysid system table tables tablespace temp template temporary text then time timestamp to trailing transaction treat trigger trim true truncate trusted type types unbounded uncommitted unencrypted union unique unknown unlisten unlogged until user using vacuum valid validate validator value values varchar variadic varying verbose version view views volatile when where whitespace window with within without work wrapper write xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlparse xmlpi xmlroot xmlserialize year yes zone ABORT ABSOLUTE ACCESS ACTION ADD ADMIN AFTER AGGREGATE ALL ALSO ALTER ALWAYS ANALYSE ANALYZE AND ANY ARRAY AS ASC ASSERTION ASSIGNMENT ASYMMETRIC AT ATTRIBUTE AUTHORIZATION BACKWARD BEFORE BEGIN BETWEEN BIGINT BINARY BIT BOOLEAN BOTH BY CACHE CALLED CASCADE CASCADED CASE CAST CATALOG CHAIN CHAR CHARACTER CHARACTERISTICS CHECK CHECKPOINT CLASS CLOSE CLUSTER COALESCE COLLATE COLLATION COLUMN COMMENT COMMENTS COMMIT COMMITTED CONCURRENTLY CONFIGURATION CONNECTION CONSTRAINT CONSTRAINTS CONTENT CONTINUE CONVERSION COPY COST CREATE CROSS CSV CURRENT CURRENT_CATALOG CURRENT_DATE CURRENT_ROLE CURRENT_SCHEMA CURRENT_TIME CURRENT_TIMESTAMP CURRENT_USER CURSOR CYCLE DATA DATABASE DAY DEALLOCATE DEC DECIMAL DECLARE DEFAULT DEFAULTS DEFERRABLE DEFERRED DEFINER DELETE DELIMITER DELIMITERS DESC DICTIONARY DISABLE DISCARD DISTINCT DO DOCUMENT DOMAIN DOUBLE DROP EACH ELSE ENABLE ENCODING ENCRYPTED END ENUM ESCAPE EVENT EXCEPT EXCLUDE EXCLUDING EXCLUSIVE EXECUTE EXISTS EXPLAIN EXTENSION EXTERNAL EXTRACT FALSE FAMILY FETCH FILTER FIRST FLOAT FOLLOWING FOR FORCE FOREIGN FORWARD FREEZE FROM FULL FUNCTION FUNCTIONS GLOBAL GRANT GRANTED GREATEST GROUP HANDLER HAVING HEADER HOLD HOUR IDENTITY IF ILIKE IMMEDIATE IMMUTABLE IMPLICIT IN INCLUDING INCREMENT INDEX INDEXES INHERIT INHERITS INITIALLY INLINE INNER INOUT INPUT INSENSITIVE INSERT INSTEAD INT INTEGER INTERSECT INTERVAL INTO INVOKER IS ISNULL ISOLATION JOIN KEY LABEL LANGUAGE LARGE LAST LATERAL LC_COLLATE LC_CTYPE LEADING LEAKPROOF LEAST LEFT LEVEL LIKE LIMIT LISTEN LOAD LOCAL LOCALTIME LOCALTIMESTAMP LOCATION LOCK MAPPING MATCH MATERIALIZED MAXVALUE MINUTE MINVALUE MODE MONTH MOVE NAME NAMES NATIONAL NATURAL NCHAR NEXT NO NONE NOT NOTHING NOTIFY NOTNULL NOWAIT NULL NULLIF NULLS NUMERIC OBJECT OF OFF OFFSET OIDS ON ONLY OPERATOR OPTION OPTIONS OR ORDER ORDINALITY OUT OUTER OVER OVERLAPS OVERLAY OWNED OWNER PARSER PARTIAL PARTITION PASSING PASSWORD PLACING PLANS POSITION PRECEDING PRECISION PREPARE PREPARED PRESERVE PRIMARY PRIOR PRIVILEGES PROCEDURAL PROCEDURE PROGRAM QUOTE RANGE READ REAL REASSIGN RECHECK RECURSIVE REF REFERENCES REFRESH REINDEX RELATIVE RELEASE RENAME REPEATABLE REPLACE REPLICA RESET RESTART RESTRICT RETURNING RETURNS REVOKE RIGHT ROLE ROLLBACK ROW ROWS RULE SAVEPOINT SCHEMA SCROLL SEARCH SECOND SECURITY SELECT SEQUENCE SEQUENCES SERIALIZABLE SERVER SESSION SESSION_USER SET SETOF SHARE SHOW SIMILAR SIMPLE SMALLINT SNAPSHOT SOME STABLE STANDALONE START STATEMENT STATISTICS STDIN STDOUT STORAGE STRICT STRIP SUBSTRING SYMMETRIC SYSID SYSTEM TABLE TABLES TABLESPACE TEMP TEMPLATE TEMPORARY TEXT THEN TIME TIMESTAMP TO TRAILING TRANSACTION TREAT TRIGGER TRIM TRUE TRUNCATE TRUSTED TYPE TYPES UNBOUNDED UNCOMMITTED UNENCRYPTED UNION UNIQUE UNKNOWN UNLISTEN UNLOGGED UNTIL USER USING VACUUM VALID VALIDATE VALIDATOR VALUE VALUES VARCHAR VARIADIC VARYING VERBOSE VERSION VIEW VIEWS VOLATILE WHEN WHERE WHITESPACE WINDOW WITH WITHIN WITHOUT WORK WRAPPER WRITE XML XMLATTRIBUTES XMLCONCAT XMLELEMENT XMLEXISTS XMLFOREST XMLPARSE XMLPI XMLROOT XMLSERIALIZE YEAR YES ZONE");
//richTextBox1.SetKeywords(1, "update UPDATE");
}
开发者ID:carlosv14,项目名称:Postgres-Manager,代码行数:31,代码来源:Sequence.cs
示例12: CanExtend_RichTextBox_True
public void CanExtend_RichTextBox_True()
{
using (RichTextBox textBox = new RichTextBox())
{
Assert.IsTrue(((IExtenderProvider) _prompt).CanExtend(textBox));
}
}
开发者ID:JohnThomson,项目名称:libpalaso,代码行数:7,代码来源:PromptTests.cs
示例13: SimpleCodeProvider
public SimpleCodeProvider(RichTextBox textBox, string path, string name)
{
_textBox = textBox;
_name = name;
_path = path;
ContainerName = typeof(SimpleCodeProvider).Assembly.FullName;
}
开发者ID:hxhlb,项目名称:jsparser,代码行数:7,代码来源:SimpleCodeProvider.cs
示例14: dodajWiadomosc
public void dodajWiadomosc(RichTextBox rt, string w)
{
if (rt.InvokeRequired)
rt.BeginInvoke(new Action<RichTextBox, string>(dodajWiadomosc), rt, w);
else
rt.AppendText(w + Environment.NewLine);
}
开发者ID:JanekGreen,项目名称:simple-local-network-communicator,代码行数:7,代码来源:Form1.cs
示例15: apieToolStripMenuItem_Click
// PVZ kitom skiltim
private void apieToolStripMenuItem_Click(object sender, EventArgs e)
{
using (Form form = new Form())
{
form.Text = apieToolStripMenuItem.Text;
form.ClientSize = new System.Drawing.Size(1000, 500);
form.MinimumSize = new System.Drawing.Size(1000, 500);
RichTextBox about = new RichTextBox();
about.Dock = DockStyle.Fill;
about.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F);
about.Location = new System.Drawing.Point(4, 4);
about.ReadOnly = true;
about.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical;
if (apieToolStripMenuItem.Text == "Apie")
{
about.Text = Alfredas.Properties.Resources.AboutLT;
}
else if (apieToolStripMenuItem.Text == "About")
{
about.Text = Alfredas.Properties.Resources.AboutEN;
}
else if (apieToolStripMenuItem.Text == "Описание")
{
about.Text = Alfredas.Properties.Resources.AboutRU;
}
form.Controls.Add(about);
form.ShowDialog();
}
}
开发者ID:kaskanoidas,项目名称:Alfredas,代码行数:30,代码来源:Form1.cs
示例16: FormGeneratedCode
public FormGeneratedCode(List<GeneratedCode> generatedCodes)
{
InitializeComponent();
this.generatedCodes = generatedCodes;
tabControl1.TabPages.Clear();
foreach (GeneratedCode gc in generatedCodes)
{
TabPage tp = new TabPage(Path.GetFileName(gc.Path));
tabControl1.TabPages.Add(tp);
tp.Tag = gc;
RichTextBox tb = new RichTextBox();
tb.AcceptsTab = true;
tb.DetectUrls = false;
tb.Dock = DockStyle.Fill;
tb.Font = new Font("Lucida Console", 9.75F, FontStyle.Regular, GraphicsUnit.Point, 162);
tb.Location = new System.Drawing.Point(3, 3);
tb.Text = gc.Code;
tb.WordWrap = false;
tb.TextChanged += delegate {
(tp.Tag as GeneratedCode).Code = tb.Text;
};
tp.Controls.Add(tb);
}
tabControl1.SelectedIndex = 0;
}
开发者ID:fizikci,项目名称:Cinar,代码行数:31,代码来源:FormGeneratedCode.cs
示例17: LeanEngineWinForm
/// <summary>
/// Launch the Lean Engine Primary Form:
/// </summary>
/// <param name="engine">Accept the engine instance we just launched</param>
public LeanEngineWinForm(Engine engine)
{
_engine = engine;
//Setup the State:
_resultsHandler = engine.AlgorithmHandlers.Results;
//Create Form:
Text = "QuantConnect Lean Algorithmic Trading Engine: v" + Constants.Version;
Size = new Size(1024,768);
MinimumSize = new Size(1024, 768);
CenterToScreen();
WindowState = FormWindowState.Maximized;
Icon = new Icon("../../../lean.ico");
//Setup Console Log Area:
_console = new RichTextBox();
_console.Parent = this;
_console.ReadOnly = true;
_console.Multiline = true;
_console.Location = new Point(0, 0);
_console.Dock = DockStyle.Fill;
_console.KeyUp += ConsoleOnKeyUp;
//Form Events:
Closed += OnClosed;
//Setup Polling Events:
_polling = new Timer();
_polling.Interval = 1000;
_polling.Tick += PollingOnTick;
_polling.Start();
}
开发者ID:skyfyl,项目名称:Lean,代码行数:36,代码来源:LeanEngineWinForm.cs
示例18: Continent
public Continent(RichTextBox displayBox, Random randomGen, int nAnimalTypes, Graphics canvas)
{
this.displayBox = displayBox;
this.canvas = canvas;
this.randomGen = randomGen;
this.nAnimalTypes = nAnimalTypes;
}
开发者ID:tsgardiner,项目名称:IN710gardits1,代码行数:7,代码来源:Continent.cs
示例19: StdIO
//--------------------------------
public StdIO(TextBox In, RichTextBox Out/*, Thread Cur*/)
{
this.Input = In;
this.Output = Out;
//this.Cur = Cur;
In.KeyPress += this.KeyPress;
}
开发者ID:bamx23,项目名称:ZInc,代码行数:8,代码来源:Program.cs
示例20: InsertPInvokeSignaturesForm
public InsertPInvokeSignaturesForm()
{
SetupFromXmlStream(this.GetType().Assembly.GetManifestResourceStream("PInvokeAddIn.Resources.InsertPInvokeSignaturesForm.xfrm"));
signatureRichTextBox = ((RichTextBox)ControlDictionary["SignatureRichTextBox"]);
// Hook up events.
closeButton = ((Button)ControlDictionary["CloseButton"]);
closeButton.Click += new EventHandler(CloseButtonClick);
insertButton = ((Button)ControlDictionary["InsertButton"]);
insertButton.Enabled = false;
insertButton.Click += new EventHandler(InsertButtonClick);
findButton = ((Button)ControlDictionary["FindButton"]);
findButton.Click += new EventHandler(FindButtonClick);
functionNameComboBox = ((ComboBox)ControlDictionary["FunctionNameComboBox"]);
functionNameComboBox.AutoCompleteMode = AutoCompleteMode.Suggest;
functionNameComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;
moduleNameComboBox = ((ComboBox)ControlDictionary["ModuleNameComboBox"]);
moduleNameComboBox.AutoCompleteMode = AutoCompleteMode.Suggest;
moduleNameComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;
moreInfoLinkLabel = ((LinkLabel)ControlDictionary["MoreInfoLinkLabel"]);
moreInfoLinkLabel.LinkClicked += new LinkLabelLinkClickedEventHandler(MoreInfoLinkClicked);
languageComboBox = ((ComboBox)ControlDictionary["LanguageComboBox"]);
languageComboBox.SelectedIndexChanged += new EventHandler(LanguageComboBoxSelectedIndexChanged);
SetupLanguages();
SetupFunctionNames();
SetupModuleNames();
}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:35,代码来源:InsertPInvokeSignaturesForm.cs
注:本文中的System.Windows.Forms.RichTextBox类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论