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. C#
  4. Tooltip

Tooltip

Scheduled Pinned Locked Moved C#
debugginghelpquestion
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.
  • B Offline
    B Offline
    bertcox
    wrote on last edited by
    #1

    Hello, I have a rather large tooltip: The debuglevel is an indicator of the amount of data that is written to the debugfile. The values should be used like this: 0 means no debug information, 1 means error only, 2 means error + informational, 3 means verbose (log as much as possible) Now i want the tooltip to look like this: The debuglevel is an indicator of the amount of data that is written to the debugfile. The values should be used like this: 0 means no debug information 1 means error only 2 means error + informational 3 means verbose (log as much as possible) So more structured. Is it possible? Thx in advance.

    W H 2 Replies Last reply
    0
    • B bertcox

      Hello, I have a rather large tooltip: The debuglevel is an indicator of the amount of data that is written to the debugfile. The values should be used like this: 0 means no debug information, 1 means error only, 2 means error + informational, 3 means verbose (log as much as possible) Now i want the tooltip to look like this: The debuglevel is an indicator of the amount of data that is written to the debugfile. The values should be used like this: 0 means no debug information 1 means error only 2 means error + informational 3 means verbose (log as much as possible) So more structured. Is it possible? Thx in advance.

      W Offline
      W Offline
      wibblewibblewibble
      wrote on last edited by
      #2

      Will String.Format not do it? Barry

      H 1 Reply Last reply
      0
      • B bertcox

        Hello, I have a rather large tooltip: The debuglevel is an indicator of the amount of data that is written to the debugfile. The values should be used like this: 0 means no debug information, 1 means error only, 2 means error + informational, 3 means verbose (log as much as possible) Now i want the tooltip to look like this: The debuglevel is an indicator of the amount of data that is written to the debugfile. The values should be used like this: 0 means no debug information 1 means error only 2 means error + informational 3 means verbose (log as much as possible) So more structured. Is it possible? Thx in advance.

        H Offline
        H Offline
        Heath Stewart
        wrote on last edited by
        #3

        Yes, just insert \n where you want a line break in your text. This is common in several controls, including the Label control. You can't use the PropertyGrid, though, since it or the TypeConverter escapes the backslash (\ to \\). For example:

        toolTip1.SetToolTip(button1, "This is\na multi-line\atool tip.");

        Microsoft MVP, Visual C# My Articles

        1 Reply Last reply
        0
        • W wibblewibblewibble

          Will String.Format not do it? Barry

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          String.Format replaces indexed parameters with values in an argument list, not stylize text.

          Microsoft MVP, Visual C# My Articles

          W 1 Reply Last reply
          0
          • H Heath Stewart

            String.Format replaces indexed parameters with values in an argument list, not stylize text.

            Microsoft MVP, Visual C# My Articles

            W Offline
            W Offline
            wibblewibblewibble
            wrote on last edited by
            #5

            Ok - sorry. For some reason I thought "\n" didn't work and had to be in a String.Format call. I can now take that of my code where I have multiple line labels!

            H 1 Reply Last reply
            0
            • W wibblewibblewibble

              Ok - sorry. For some reason I thought "\n" didn't work and had to be in a String.Format call. I can now take that of my code where I have multiple line labels!

              H Offline
              H Offline
              Heath Stewart
              wrote on last edited by
              #6

              No, it just doesn't work if you type \n in the PropertyGrid or something, since it gets escaped. You just have to assign the string "manually" (personally, I don't use the forms designers for much besides initial layout anyway since I deal a lot with localization and dynamic applications).

              Microsoft MVP, Visual C# My Articles

              B 1 Reply Last reply
              0
              • H Heath Stewart

                No, it just doesn't work if you type \n in the PropertyGrid or something, since it gets escaped. You just have to assign the string "manually" (personally, I don't use the forms designers for much besides initial layout anyway since I deal a lot with localization and dynamic applications).

                Microsoft MVP, Visual C# My Articles

                B Offline
                B Offline
                bertcox
                wrote on last edited by
                #7

                answered my question already ;-) i wanted to say that i already wrote al my tooltips in the propertygrid. But '\n' didn't work there so i'll have to start copy pasting ;-)

                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