Capitalize bold word to upper case in web browser control in C# windows form












0














I am using a web browser control in my C# windows form and need to capitalize all bold word by default when typing. I looked up and found out that execcommand support stylewithcss ( https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand)



The bold button function I wrote is:



private void boldButton_Click(object sender, EventArgs e)       
{
webBrowser1.Document.ExecCommand("Bold", false, new { @class = "<span style= style=text-transform:uppercase;>" });
}


But it only makes the text bold and not UPPERCASE, any help in this matter would be appreciated.










share|improve this question



























    0














    I am using a web browser control in my C# windows form and need to capitalize all bold word by default when typing. I looked up and found out that execcommand support stylewithcss ( https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand)



    The bold button function I wrote is:



    private void boldButton_Click(object sender, EventArgs e)       
    {
    webBrowser1.Document.ExecCommand("Bold", false, new { @class = "<span style= style=text-transform:uppercase;>" });
    }


    But it only makes the text bold and not UPPERCASE, any help in this matter would be appreciated.










    share|improve this question

























      0












      0








      0







      I am using a web browser control in my C# windows form and need to capitalize all bold word by default when typing. I looked up and found out that execcommand support stylewithcss ( https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand)



      The bold button function I wrote is:



      private void boldButton_Click(object sender, EventArgs e)       
      {
      webBrowser1.Document.ExecCommand("Bold", false, new { @class = "<span style= style=text-transform:uppercase;>" });
      }


      But it only makes the text bold and not UPPERCASE, any help in this matter would be appreciated.










      share|improve this question













      I am using a web browser control in my C# windows form and need to capitalize all bold word by default when typing. I looked up and found out that execcommand support stylewithcss ( https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand)



      The bold button function I wrote is:



      private void boldButton_Click(object sender, EventArgs e)       
      {
      webBrowser1.Document.ExecCommand("Bold", false, new { @class = "<span style= style=text-transform:uppercase;>" });
      }


      But it only makes the text bold and not UPPERCASE, any help in this matter would be appreciated.







      c# winforms webbrowser-control






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 20 '18 at 10:09









      Fatima Khalid

      33




      33
























          1 Answer
          1






          active

          oldest

          votes


















          0
















          I don't understand what are you trying to do. But if you want to make a text bold and capitalize at the same time, simply, you can add




          style="text-transform: capitalize; font-weight:bold;"




          attributes to html tags like



          <input type="text" style="text-transform: capitalize; font-weight:bold"/>


          you don't need call execCommand. Btw,If you read carefully that document, there is no Capitalize method for execCommand.






          share|improve this answer





















          • But how can I do this in a windows form in web browser control?
            – Fatima Khalid
            Nov 20 '18 at 10:50










          • I cannot do styling in a web browser control by default.
            – Fatima Khalid
            Nov 20 '18 at 10:51










          • Ohh, I understand now. You are trying to manipulate the loaded web page on web browser control. I don't know how you can do that but maybe you can add a style section into <head> area to manipulate desired html tags or class when page loaded.
            – mafirat
            Nov 20 '18 at 12:09











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53390646%2fcapitalize-bold-word-to-upper-case-in-web-browser-control-in-c-sharp-windows-for%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0
















          I don't understand what are you trying to do. But if you want to make a text bold and capitalize at the same time, simply, you can add




          style="text-transform: capitalize; font-weight:bold;"




          attributes to html tags like



          <input type="text" style="text-transform: capitalize; font-weight:bold"/>


          you don't need call execCommand. Btw,If you read carefully that document, there is no Capitalize method for execCommand.






          share|improve this answer





















          • But how can I do this in a windows form in web browser control?
            – Fatima Khalid
            Nov 20 '18 at 10:50










          • I cannot do styling in a web browser control by default.
            – Fatima Khalid
            Nov 20 '18 at 10:51










          • Ohh, I understand now. You are trying to manipulate the loaded web page on web browser control. I don't know how you can do that but maybe you can add a style section into <head> area to manipulate desired html tags or class when page loaded.
            – mafirat
            Nov 20 '18 at 12:09
















          0
















          I don't understand what are you trying to do. But if you want to make a text bold and capitalize at the same time, simply, you can add




          style="text-transform: capitalize; font-weight:bold;"




          attributes to html tags like



          <input type="text" style="text-transform: capitalize; font-weight:bold"/>


          you don't need call execCommand. Btw,If you read carefully that document, there is no Capitalize method for execCommand.






          share|improve this answer





















          • But how can I do this in a windows form in web browser control?
            – Fatima Khalid
            Nov 20 '18 at 10:50










          • I cannot do styling in a web browser control by default.
            – Fatima Khalid
            Nov 20 '18 at 10:51










          • Ohh, I understand now. You are trying to manipulate the loaded web page on web browser control. I don't know how you can do that but maybe you can add a style section into <head> area to manipulate desired html tags or class when page loaded.
            – mafirat
            Nov 20 '18 at 12:09














          0












          0








          0








          I don't understand what are you trying to do. But if you want to make a text bold and capitalize at the same time, simply, you can add




          style="text-transform: capitalize; font-weight:bold;"




          attributes to html tags like



          <input type="text" style="text-transform: capitalize; font-weight:bold"/>


          you don't need call execCommand. Btw,If you read carefully that document, there is no Capitalize method for execCommand.






          share|improve this answer














          I don't understand what are you trying to do. But if you want to make a text bold and capitalize at the same time, simply, you can add




          style="text-transform: capitalize; font-weight:bold;"




          attributes to html tags like



          <input type="text" style="text-transform: capitalize; font-weight:bold"/>


          you don't need call execCommand. Btw,If you read carefully that document, there is no Capitalize method for execCommand.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 20 '18 at 10:45









          mafirat

          814




          814












          • But how can I do this in a windows form in web browser control?
            – Fatima Khalid
            Nov 20 '18 at 10:50










          • I cannot do styling in a web browser control by default.
            – Fatima Khalid
            Nov 20 '18 at 10:51










          • Ohh, I understand now. You are trying to manipulate the loaded web page on web browser control. I don't know how you can do that but maybe you can add a style section into <head> area to manipulate desired html tags or class when page loaded.
            – mafirat
            Nov 20 '18 at 12:09


















          • But how can I do this in a windows form in web browser control?
            – Fatima Khalid
            Nov 20 '18 at 10:50










          • I cannot do styling in a web browser control by default.
            – Fatima Khalid
            Nov 20 '18 at 10:51










          • Ohh, I understand now. You are trying to manipulate the loaded web page on web browser control. I don't know how you can do that but maybe you can add a style section into <head> area to manipulate desired html tags or class when page loaded.
            – mafirat
            Nov 20 '18 at 12:09
















          But how can I do this in a windows form in web browser control?
          – Fatima Khalid
          Nov 20 '18 at 10:50




          But how can I do this in a windows form in web browser control?
          – Fatima Khalid
          Nov 20 '18 at 10:50












          I cannot do styling in a web browser control by default.
          – Fatima Khalid
          Nov 20 '18 at 10:51




          I cannot do styling in a web browser control by default.
          – Fatima Khalid
          Nov 20 '18 at 10:51












          Ohh, I understand now. You are trying to manipulate the loaded web page on web browser control. I don't know how you can do that but maybe you can add a style section into <head> area to manipulate desired html tags or class when page loaded.
          – mafirat
          Nov 20 '18 at 12:09




          Ohh, I understand now. You are trying to manipulate the loaded web page on web browser control. I don't know how you can do that but maybe you can add a style section into <head> area to manipulate desired html tags or class when page loaded.
          – mafirat
          Nov 20 '18 at 12:09


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53390646%2fcapitalize-bold-word-to-upper-case-in-web-browser-control-in-c-sharp-windows-for%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

          Alcedinidae

          Origin of the phrase “under your belt”?