1 Replies - 347 Views - Last Post: 28 April 2013 - 01:46 AM Rate Topic: -----

#1 kidpro  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 30-October 12

error:cannot implicity string to label

Posted 28 April 2013 - 01:40 AM

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
           <b>newform.lbl_view_title = this.BookTitle;</b>
        }

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

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


            CSharp.GetDetails();


Is This A Good Question/Topic? 0
  • +

Replies To: error:cannot implicity string to label

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5481
  • View blog
  • Posts: 11,762
  • Joined: 02-June 10

Re: error:cannot implicity string to label

Posted 28 April 2013 - 01:46 AM

You don't set a label to a string. You set the .Text property

MyLable.Text = "yogi bear";
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1