C# Put string into TextBox

后端 未结 3 1100
暖寄归人
暖寄归人 2020-12-02 00:34

I want to show the results of this code in my TextBox:

       string txtout1 = txtOrgText.Text.Replace(parm, txtTo.Text).ToString();
       txtout = txtout1;         


        
3条回答
  •  一生所求
    2020-12-02 00:44

    First of all txtout = txtout1; will not serve as txtout is a textbox and txtout1 is a string .You should use

    txtout.Text = txtout1

    ie .Text property of textbox says Gets or Sets the current text in System.Windows.Forms.TextBox and its type is string as your txtout1 is already a string there is no need to convert it again by using .ToString()

提交回复
热议问题