需要帮助:不能无法将字符串隐含在Windows窗体标签上 [英] Need Help :cannot not implicity string to windows form labels

查看:73
本文介绍了需要帮助:不能无法将字符串隐含在Windows窗体标签上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在一个标签上显示我的结果我希望在书籍类的方法中使用

I want to show my result on a lable which i want to use in a method of book class

class Book
    {
        Form1 newform = new Form1();
        public string BookTitle;
        public string BookAuthor;
        public string PublishDate;
        public const string Publisher = "MICROSOFT";


        public void GetDetails()
        {
          // showing error here cannot implicity string to lable
           newform.lbl_view_title = this.BookTitle;
        }

    }
private void btnMain_Click(object sender, EventArgs e)
        {

            CSharp.BookTitle = textBox1.Text;
            CSharp.BookAuthor = textBox2.Text; 
            CSharp.PublishDate = textBox3.Text;


            CSharp.GetDetails();
        }

推荐答案

您好,



尝试:

Hi,

Try:
newform.lbl_view_title.Text = this.BookTitle;



希望这会有所帮助。


Hope this helps.


AddMethodToClassTextBoxesresult.exe中发生未处理的System.StackOverflowException类型异常





当我运行时我有错误

Form1 newform = new Form1();
An unhandled exception of type ''System.StackOverflowException'' occurred in AddMethodToClassTextBoxesresult.exe


when i run then i have the error on
Form1 newform = new Form1();


这篇关于需要帮助:不能无法将字符串隐含在Windows窗体标签上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆