{"id":13544,"date":"2022-10-04T10:30:30","date_gmt":"2022-10-04T05:00:30","guid":{"rendered":"https:\/\/jassweb.com\/solved\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\/"},"modified":"2022-10-04T10:30:30","modified_gmt":"2022-10-04T05:00:30","slug":"solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\/","title":{"rendered":"[Solved] Might be a silly question, but how do you set the label of a c# button ? (winforms)"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-70186820\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"70186820\" data-parentid=\"70186796\" data-score=\"3\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<p>Classes that descend from <code>Control<\/code> have a <code>Text<\/code> <strong>property<\/strong> you can set for this, and a <code>Button<\/code> is one of those.. Some controls like Button and Label have a Text that isn&#8217;t set by the user, only the developer. Others (TextBox) are user editable, and you&#8217;d read from the Text property to find out what the user has typed into it<\/p>\n<p>Some controls don&#8217;t really have a sensible use for a Text property (DataGridView, for example) but they descend from Control, so they have one (that isn&#8217;t used)<\/p>\n<p>In C# a <strong>property<\/strong> is like a variable: you set a value for it by putting it on the left hand side of an <code>=<\/code>:<\/p>\n<pre><code>label.Text = \"Hello\";\n<\/code><\/pre>\n<p>You can read from them too:<\/p>\n<pre><code>MessageBox.Show(\"You typed \" + textbox.Text);\n<\/code><\/pre>\n<p>Methods and properties are different; methods &#8220;do something&#8221;; <code>.Show<\/code> above is a method; it shows a MessageBox, and you pass a string into it as an argument, but it&#8217;s different to a property.<\/p>\n<p>You don&#8217;t set a property by invoking (running) it &#8211; your attempt in the comments <code>button.Text(\"My button label\")<\/code> would work if button had a Text <em>method<\/em>, but <code>Text<\/code> on a button is a <em>property<\/em>, not a method..<\/p>\n<p>When you&#8217;re looking at C# for the most part you can tell whether something is a property or a method by seeing if there is an open parenthesis <code>(<\/code> following it. Methods also have verb names, whereas properties are nouns:<\/p>\n<pre><code>textbox.Clear(); \ntextbox.Text = \"hello\";\ntextbox.AppendText(\"world\");\n<\/code><\/pre>\n<\/p><\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\">2<\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved Might be a silly question, but how do you set the label of a c# button ? (winforms) <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] Classes that descend from Control have a Text property you can set for this, and a Button is one of those.. Some controls like Button and Label have a Text that isn&#8217;t set by the user, only the developer. Others (TextBox) are user editable, and you&#8217;d read from the Text property to find out &#8230; <a title=\"[Solved] Might be a silly question, but how do you set the label of a c# button ? (winforms)\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\/\" aria-label=\"More on [Solved] Might be a silly question, but how do you set the label of a c# button ? (winforms)\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[954,324,959],"class_list":["post-13544","post","type-post","status-publish","format-standard","hentry","category-solved","tag-button","tag-c","tag-winforms"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>[Solved] Might be a silly question, but how do you set the label of a c# button ? (winforms) - JassWeb<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jassweb.com\/solved\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved] Might be a silly question, but how do you set the label of a c# button ? (winforms) - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] Classes that descend from Control have a Text property you can set for this, and a Button is one of those.. Some controls like Button and Label have a Text that isn&#8217;t set by the user, only the developer. Others (TextBox) are user editable, and you&#8217;d read from the Text property to find out ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-04T05:00:30+00:00\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\\\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/person\\\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"[Solved] Might be a silly question, but how do you set the label of a c# button ? (winforms)\",\"datePublished\":\"2022-10-04T05:00:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\\\/\"},\"wordCount\":264,\"publisher\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#organization\"},\"keywords\":[\"button\",\"c++\",\"winforms\"],\"articleSection\":[\"Solved\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\\\/\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\\\/\",\"name\":\"[Solved] Might be a silly question, but how do you set the label of a c# button ? (winforms) - JassWeb\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#website\"},\"datePublished\":\"2022-10-04T05:00:30+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Solved] Might be a silly question, but how do you set the label of a c# button ? (winforms)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#website\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/jassweb.com\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/jass-website-logo-1.png\",\"contentUrl\":\"https:\\\/\\\/jassweb.com\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/person\\\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/wp-content\\\/litespeed\\\/avatar\\\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/wp-content\\\/litespeed\\\/avatar\\\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400\",\"contentUrl\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/wp-content\\\/litespeed\\\/avatar\\\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\\\/\\\/jassweb.com\"],\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/author\\\/jaspritsinghghumangmail-com\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved] Might be a silly question, but how do you set the label of a c# button ? (winforms) - JassWeb","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jassweb.com\/solved\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\/","og_locale":"en_US","og_type":"article","og_title":"[Solved] Might be a silly question, but how do you set the label of a c# button ? (winforms) - JassWeb","og_description":"[ad_1] Classes that descend from Control have a Text property you can set for this, and a Button is one of those.. Some controls like Button and Label have a Text that isn&#8217;t set by the user, only the developer. Others (TextBox) are user editable, and you&#8217;d read from the Text property to find out ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\/","og_site_name":"JassWeb","article_published_time":"2022-10-04T05:00:30+00:00","author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"[Solved] Might be a silly question, but how do you set the label of a c# button ? (winforms)","datePublished":"2022-10-04T05:00:30+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\/"},"wordCount":264,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"keywords":["button","c++","winforms"],"articleSection":["Solved"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\/","url":"https:\/\/jassweb.com\/solved\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\/","name":"[Solved] Might be a silly question, but how do you set the label of a c# button ? (winforms) - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"datePublished":"2022-10-04T05:00:30+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-might-be-a-silly-question-but-how-do-you-set-the-label-of-a-c-button-winforms\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"[Solved] Might be a silly question, but how do you set the label of a c# button ? (winforms)"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777008400","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/13544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=13544"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/13544\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=13544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=13544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=13544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}