c# - Access from a different classes to the RichTextBox of MainForm.cs (Windows Forms Application) -


For example, in the same class, I am using the word "this" but I am from another class in this RichTextBox How can I access Remove Private Zero Symbology Click (Object Sender, Event Argus E) {string text = this.dataTextBox.Text; This.dataTextBox.Text = text.Remove (0, 1); }

The examples below are not working.

  MainForm MF = new mainform (); Mf.dataTextBox.Text = text.Remove (0, 1);   

or

  MainForm MF; Mf.dataTextBox.Text = text.Remove (0, 1);   

does not work

try it,

in its main form;

  Public MainForm () {InitializeComponent (); Main = this; } Internal Stable MainForm Main; Receive internal string position {return {return dataTextBox.Text.ToString ()}} set {dataTextBox.Text = value; }}   

from your calling class,

  MainForm.main.Status = "Your message";   

:)

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -