{"id":51293,"date":"2024-04-15T23:22:44","date_gmt":"2024-04-15T23:22:44","guid":{"rendered":"https:\/\/exam.pscnotes.com\/mcq\/?p=51293"},"modified":"2024-04-15T23:22:44","modified_gmt":"2024-04-15T23:22:44","slug":"e-parameters-property-is-used-to-determine-the-pressed-key","status":"publish","type":"post","link":"https:\/\/exam.pscnotes.com\/mcq\/e-parameters-property-is-used-to-determine-the-pressed-key\/","title":{"rendered":"e&#8217; parameter&#8217;s . . . . . . . . property is used to determine the pressed key."},"content":{"rendered":"<p>[amp_mcq option1=&#8221;Keypress&#8221; option2=&#8221;KeyChar&#8221; option3=&#8221;Keychar&#8221; option4=&#8221;Key.Char&#8221; correct=&#8221;option2&#8243;]<!--more--><\/p>\n<p>The correct answer is: <strong>B. KeyChar<\/strong><\/p>\n<p>The <code>KeyChar<\/code> property of the <code>e<\/code> parameter is used to determine the pressed key. It returns a character that represents the key that was pressed.<\/p>\n<p>The <code>Keypress<\/code> property returns a string that represents the key that was pressed. It includes the key code and the character code.<\/p>\n<p>The <code>Keychar<\/code> property is not a valid property.<\/p>\n<p>The <code>Key.Char<\/code> property is not a valid property.<\/p>\n<p>Here is an example of how to use the <code>KeyChar<\/code> property:<\/p>\n<p>&#8220;`<br \/>\nusing System;<br \/>\nusing System.Windows.Forms;<\/p>\n<p>public class Form1 : Form<br \/>\n{<br \/>\n    public Form1()<br \/>\n    {<br \/>\n        InitializeComponent();<\/p>\n<pre><code>    \/\/ Add a KeyDown event handler to the button.\n    Button button1.KeyDown += new KeyEventHandler(button1_KeyDown);\n}\n\nprivate void button1_KeyDown(object sender, KeyEventArgs e)\n{\n    \/\/ Display the character that was pressed.\n    MessageBox.Show(e.KeyChar.ToString());\n}\n<\/code><\/pre>\n<p>}<br \/>\n&#8220;`<\/p>\n<p>When you press a key on the keyboard, the <code>KeyDown<\/code> event is raised. The <code>e<\/code> parameter of the <code>KeyDown<\/code> event contains information about the key that was pressed. The <code>KeyChar<\/code> property of the <code>e<\/code> parameter returns the character that represents the key that was pressed. In the example above, the <code>KeyChar<\/code> property is used to display the character that was pressed in a message box.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[amp_mcq option1=&#8221;Keypress&#8221; option2=&#8221;KeyChar&#8221; option3=&#8221;Keychar&#8221; option4=&#8221;Key.Char&#8221; correct=&#8221;option2&#8243;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[731],"tags":[],"class_list":["post-51293","post","type-post","status-publish","format-standard","hentry","category-visual-basic","no-featured-image-padding"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.2 (Yoast SEO v23.3) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>e&#039; parameter&#039;s . . . . . . . . property is used to determine the pressed key.<\/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:\/\/exam.pscnotes.com\/mcq\/e-parameters-property-is-used-to-determine-the-pressed-key\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"e&#039; parameter&#039;s . . . . . . . . property is used to determine the pressed key.\" \/>\n<meta property=\"og:description\" content=\"[amp_mcq option1=&#8221;Keypress&#8221; option2=&#8221;KeyChar&#8221; option3=&#8221;Keychar&#8221; option4=&#8221;Key.Char&#8221; correct=&#8221;option2&#8243;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/exam.pscnotes.com\/mcq\/e-parameters-property-is-used-to-determine-the-pressed-key\/\" \/>\n<meta property=\"og:site_name\" content=\"MCQ and Quiz for Exams\" \/>\n<meta property=\"article:published_time\" content=\"2024-04-15T23:22:44+00:00\" \/>\n<meta name=\"author\" content=\"rawan239\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"rawan239\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"e' parameter's . . . . . . . . property is used to determine the pressed key.","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:\/\/exam.pscnotes.com\/mcq\/e-parameters-property-is-used-to-determine-the-pressed-key\/","og_locale":"en_US","og_type":"article","og_title":"e' parameter's . . . . . . . . property is used to determine the pressed key.","og_description":"[amp_mcq option1=&#8221;Keypress&#8221; option2=&#8221;KeyChar&#8221; option3=&#8221;Keychar&#8221; option4=&#8221;Key.Char&#8221; correct=&#8221;option2&#8243;]","og_url":"https:\/\/exam.pscnotes.com\/mcq\/e-parameters-property-is-used-to-determine-the-pressed-key\/","og_site_name":"MCQ and Quiz for Exams","article_published_time":"2024-04-15T23:22:44+00:00","author":"rawan239","twitter_card":"summary_large_image","twitter_misc":{"Written by":"rawan239","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/exam.pscnotes.com\/mcq\/e-parameters-property-is-used-to-determine-the-pressed-key\/","url":"https:\/\/exam.pscnotes.com\/mcq\/e-parameters-property-is-used-to-determine-the-pressed-key\/","name":"e' parameter's . . . . . . . . property is used to determine the pressed key.","isPartOf":{"@id":"https:\/\/exam.pscnotes.com\/mcq\/#website"},"datePublished":"2024-04-15T23:22:44+00:00","dateModified":"2024-04-15T23:22:44+00:00","author":{"@id":"https:\/\/exam.pscnotes.com\/mcq\/#\/schema\/person\/5807dafeb27d2ec82344d6cbd6c3d209"},"breadcrumb":{"@id":"https:\/\/exam.pscnotes.com\/mcq\/e-parameters-property-is-used-to-determine-the-pressed-key\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/exam.pscnotes.com\/mcq\/e-parameters-property-is-used-to-determine-the-pressed-key\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/exam.pscnotes.com\/mcq\/e-parameters-property-is-used-to-determine-the-pressed-key\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/exam.pscnotes.com\/mcq\/"},{"@type":"ListItem","position":2,"name":"mcq","item":"https:\/\/exam.pscnotes.com\/mcq\/category\/mcq\/"},{"@type":"ListItem","position":3,"name":"Visual basic","item":"https:\/\/exam.pscnotes.com\/mcq\/category\/mcq\/visual-basic\/"},{"@type":"ListItem","position":4,"name":"e&#8217; parameter&#8217;s . . . . . . . . property is used to determine the pressed key."}]},{"@type":"WebSite","@id":"https:\/\/exam.pscnotes.com\/mcq\/#website","url":"https:\/\/exam.pscnotes.com\/mcq\/","name":"MCQ and Quiz for Exams","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/exam.pscnotes.com\/mcq\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/exam.pscnotes.com\/mcq\/#\/schema\/person\/5807dafeb27d2ec82344d6cbd6c3d209","name":"rawan239","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/exam.pscnotes.com\/mcq\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/761a7274f9cce048fa5b921221e7934820d74514df93ef195a9d22af0c1c9001?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/761a7274f9cce048fa5b921221e7934820d74514df93ef195a9d22af0c1c9001?s=96&d=mm&r=g","caption":"rawan239"},"sameAs":["https:\/\/exam.pscnotes.com"],"url":"https:\/\/exam.pscnotes.com\/mcq\/author\/rawan239\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/exam.pscnotes.com\/mcq\/wp-json\/wp\/v2\/posts\/51293","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/exam.pscnotes.com\/mcq\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/exam.pscnotes.com\/mcq\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/exam.pscnotes.com\/mcq\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/exam.pscnotes.com\/mcq\/wp-json\/wp\/v2\/comments?post=51293"}],"version-history":[{"count":0,"href":"https:\/\/exam.pscnotes.com\/mcq\/wp-json\/wp\/v2\/posts\/51293\/revisions"}],"wp:attachment":[{"href":"https:\/\/exam.pscnotes.com\/mcq\/wp-json\/wp\/v2\/media?parent=51293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/exam.pscnotes.com\/mcq\/wp-json\/wp\/v2\/categories?post=51293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/exam.pscnotes.com\/mcq\/wp-json\/wp\/v2\/tags?post=51293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}