Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. rich text editor -changing font size alone in vb.net language

rich text editor -changing font size alone in vb.net language

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharphelp
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lakshmi Dhivya
    wrote on last edited by
    #1

    Hi to all.This Is Lakshmi Dhivya,Iam doing my Engineering on Information Technology(IT),and I have decided to make an editor with all possible formatting options. I have selected vb.net as a programming language for my project. I have started designing the Rich Text editor,but Iam unable to change the font size alone with different font text selected.I have added a font comobox and a size combobox,but i need to change font alone and size alone with different font text selected. I request help from You all to finish my project Thanks in advance to every one.

    L B 3 Replies Last reply
    0
    • L Lakshmi Dhivya

      Hi to all.This Is Lakshmi Dhivya,Iam doing my Engineering on Information Technology(IT),and I have decided to make an editor with all possible formatting options. I have selected vb.net as a programming language for my project. I have started designing the Rich Text editor,but Iam unable to change the font size alone with different font text selected.I have added a font comobox and a size combobox,but i need to change font alone and size alone with different font text selected. I request help from You all to finish my project Thanks in advance to every one.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You have not really explained what the problem is. If you select a new font from the font combo then the current font size should be used. And if you select a new height then the current font should be used. Alternatively you could use the FontDialog class[^].

      1 Reply Last reply
      0
      • L Lakshmi Dhivya

        Hi to all.This Is Lakshmi Dhivya,Iam doing my Engineering on Information Technology(IT),and I have decided to make an editor with all possible formatting options. I have selected vb.net as a programming language for my project. I have started designing the Rich Text editor,but Iam unable to change the font size alone with different font text selected.I have added a font comobox and a size combobox,but i need to change font alone and size alone with different font text selected. I request help from You all to finish my project Thanks in advance to every one.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        http://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox.selectionfont(v=vs.110).aspx[^] Example at the bottom of the page.

        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

        1 Reply Last reply
        0
        • L Lakshmi Dhivya

          Hi to all.This Is Lakshmi Dhivya,Iam doing my Engineering on Information Technology(IT),and I have decided to make an editor with all possible formatting options. I have selected vb.net as a programming language for my project. I have started designing the Rich Text editor,but Iam unable to change the font size alone with different font text selected.I have added a font comobox and a size combobox,but i need to change font alone and size alone with different font text selected. I request help from You all to finish my project Thanks in advance to every one.

          B Offline
          B Offline
          Bernhard Hiller
          wrote on last edited by
          #4

          You have to create a new Font object, based on the previous font object, with the new FontSize. That's the bad thing with Fonts: they are immutable, and changing a property of a font can only be done be creating a new one with the different property.

          L 1 Reply Last reply
          0
          • B Bernhard Hiller

            You have to create a new Font object, based on the previous font object, with the new FontSize. That's the bad thing with Fonts: they are immutable, and changing a property of a font can only be done be creating a new one with the different property.

            L Offline
            L Offline
            Lakshmi Dhivya
            wrote on last edited by
            #5

            I have found that in wordpad if you select a text content typed in different fonts the font combobox will not show any font and if you change the size, only the size of the selected text changes and not the fonts. How To do this. This Is my Problem,I think i have told the exact problem. Awaiting positive response form you all.

            L B 2 Replies Last reply
            0
            • L Lakshmi Dhivya

              I have found that in wordpad if you select a text content typed in different fonts the font combobox will not show any font and if you change the size, only the size of the selected text changes and not the fonts. How To do this. This Is my Problem,I think i have told the exact problem. Awaiting positive response form you all.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Bernhard has explained what you need to do. Remember, what you see on the menu of Wordpad does not tell you what is happening internally. Every time you want to display characters in a particular font then you need to create a new one, even if you are only changing the size.

              1 Reply Last reply
              0
              • L Lakshmi Dhivya

                I have found that in wordpad if you select a text content typed in different fonts the font combobox will not show any font and if you change the size, only the size of the selected text changes and not the fonts. How To do this. This Is my Problem,I think i have told the exact problem. Awaiting positive response form you all.

                B Offline
                B Offline
                Bernhard Hiller
                wrote on last edited by
                #7

                That means that you have to split the selection into regions with the same font, and then apply the method described above for each section individually.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups