Convert String to COlor

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jcrouse

    Convert String to COlor

    I decided to start a new thread. I have output in xml file format. It looks
    like this:

    <P1JoyUp>
    <Top>326</Top>
    <Left>54</Left>
    <Height>23</Height>
    <Width>100</Width>
    <Visible>True </Visible>
    <ForeColor>Colo r [White]</ForeColor>
    <BackColor>Colo r [Transparent]</BackColor>
    <Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3,
    GdiCharSet=0, GdiVerticalFont =False]</Font>
    </P1JoyUp>

    I write it out and read it in using a data set. Now when I read it in I need
    to convert the forecolor and backcolor strings to system.drawing. something.
    WHere do I need to look for an answer.

    Thanks,
    John


  • Scott M.

    #2
    Re: Convert String to COlor

    Have you tried converting to a color in the color class?

    "jcrouse" <john.crouse@co mcast.net> wrote in message
    news:uTtokEDUEH A.2408@tk2msftn gp13.phx.gbl...[color=blue]
    > I decided to start a new thread. I have output in xml file format. It[/color]
    looks[color=blue]
    > like this:
    >
    > <P1JoyUp>
    > <Top>326</Top>
    > <Left>54</Left>
    > <Height>23</Height>
    > <Width>100</Width>
    > <Visible>True </Visible>
    > <ForeColor>Colo r [White]</ForeColor>
    > <BackColor>Colo r [Transparent]</BackColor>
    > <Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3,
    > GdiCharSet=0, GdiVerticalFont =False]</Font>
    > </P1JoyUp>
    >
    > I write it out and read it in using a data set. Now when I read it in I[/color]
    need[color=blue]
    > to convert the forecolor and backcolor strings to[/color]
    system.drawing. something.[color=blue]
    > WHere do I need to look for an answer.
    >
    > Thanks,
    > John
    >
    >[/color]


    Comment

    • jcrouse

      #3
      Re: Convert String to COlor

      I'm looking at the Color class and typeconverters but I dont' understand the
      typedescriptor parameter or the example they give in the msdn help.

      John

      "Scott M." <s-mar@nospam.nosp am> wrote in message
      news:uW5hCVDUEH A.2940@TK2MSFTN GP09.phx.gbl...[color=blue]
      > Have you tried converting to a color in the color class?
      >
      > "jcrouse" <john.crouse@co mcast.net> wrote in message
      > news:uTtokEDUEH A.2408@tk2msftn gp13.phx.gbl...[color=green]
      > > I decided to start a new thread. I have output in xml file format. It[/color]
      > looks[color=green]
      > > like this:
      > >
      > > <P1JoyUp>
      > > <Top>326</Top>
      > > <Left>54</Left>
      > > <Height>23</Height>
      > > <Width>100</Width>
      > > <Visible>True </Visible>
      > > <ForeColor>Colo r [White]</ForeColor>
      > > <BackColor>Colo r [Transparent]</BackColor>
      > > <Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3,
      > > GdiCharSet=0, GdiVerticalFont =False]</Font>
      > > </P1JoyUp>
      > >
      > > I write it out and read it in using a data set. Now when I read it in I[/color]
      > need[color=green]
      > > to convert the forecolor and backcolor strings to[/color]
      > system.drawing. something.[color=green]
      > > WHere do I need to look for an answer.
      > >
      > > Thanks,
      > > John
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Scott M.

        #4
        Re: Convert String to COlor

        How about CType(colorStri ng,color) ... haven't tried this though.


        "jcrouse" <me> wrote in message
        news:%238VrH6DU EHA.2324@TK2MSF TNGP10.phx.gbl. ..[color=blue]
        > I'm looking at the Color class and typeconverters but I dont' understand[/color]
        the[color=blue]
        > typedescriptor parameter or the example they give in the msdn help.
        >
        > John
        >
        > "Scott M." <s-mar@nospam.nosp am> wrote in message
        > news:uW5hCVDUEH A.2940@TK2MSFTN GP09.phx.gbl...[color=green]
        > > Have you tried converting to a color in the color class?
        > >
        > > "jcrouse" <john.crouse@co mcast.net> wrote in message
        > > news:uTtokEDUEH A.2408@tk2msftn gp13.phx.gbl...[color=darkred]
        > > > I decided to start a new thread. I have output in xml file format. It[/color]
        > > looks[color=darkred]
        > > > like this:
        > > >
        > > > <P1JoyUp>
        > > > <Top>326</Top>
        > > > <Left>54</Left>
        > > > <Height>23</Height>
        > > > <Width>100</Width>
        > > > <Visible>True </Visible>
        > > > <ForeColor>Colo r [White]</ForeColor>
        > > > <BackColor>Colo r [Transparent]</BackColor>
        > > > <Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3,
        > > > GdiCharSet=0, GdiVerticalFont =False]</Font>
        > > > </P1JoyUp>
        > > >
        > > > I write it out and read it in using a data set. Now when I read it in[/color][/color][/color]
        I[color=blue][color=green]
        > > need[color=darkred]
        > > > to convert the forecolor and backcolor strings to[/color]
        > > system.drawing. something.[color=darkred]
        > > > WHere do I need to look for an answer.
        > > >
        > > > Thanks,
        > > > John
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Cor Ligthert

          #5
          Re: Convert String to COlor

          Hi John,

          It is possible with that string to extract it using a regex, a split or an
          indexof or any combination of that.

          However much easier is just to save the components of the font seperatly in
          your XML file
          (I showed you it the way you did to make it not that difficult explaining it
          in a message, although I told that somewhere in a thread of you in this
          newsgroup)

          blablaFontName = textbox1.font.n ame.tostring
          blablaFondSize = textbox1.font.s ize.tostring
          etc.

          Than setting it back is much easier
          textbox1.font = new font(blablaFont Name, csng(blablaFont Size))

          I hope this helps?

          Cor


          Comment

          • One Handed Man \( OHM#\)

            #6
            Re: Convert String to COlor

            Color.FromName( "White")

            OHM

            "jcrouse" <john.crouse@co mcast.net> wrote in message
            news:uTtokEDUEH A.2408@tk2msftn gp13.phx.gbl...[color=blue]
            > I decided to start a new thread. I have output in xml file format. It[/color]
            looks[color=blue]
            > like this:
            >
            > <P1JoyUp>
            > <Top>326</Top>
            > <Left>54</Left>
            > <Height>23</Height>
            > <Width>100</Width>
            > <Visible>True </Visible>
            > <ForeColor>Colo r [White]</ForeColor>
            > <BackColor>Colo r [Transparent]</BackColor>
            > <Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3,
            > GdiCharSet=0, GdiVerticalFont =False]</Font>
            > </P1JoyUp>
            >
            > I write it out and read it in using a data set. Now when I read it in I[/color]
            need[color=blue]
            > to convert the forecolor and backcolor strings to[/color]
            system.drawing. something.[color=blue]
            > WHere do I need to look for an answer.
            >
            > Thanks,
            > John
            >
            >[/color]


            Comment

            • Cor Ligthert

              #7
              Re: Convert String to COlor

              Hi OHM,

              I saw I did give the wrong answer on the right question.

              (My message was an answer on another question from John in another thread)

              (Ken did give this answer as well, so I thought it was another question)

              However, thanks for correcting me.

              Cor


              Comment

              • J M

                #8
                Re: Convert String to COlor

                I always use Color.ToARGB to write, and
                Color.FromARGB to read them back again.
                I think that's much easier to do...

                Hope I helped,


                J Mous

                "jcrouse" <john.crouse@co mcast.net> schreef in bericht
                news:uTtokEDUEH A.2408@tk2msftn gp13.phx.gbl...[color=blue]
                > I decided to start a new thread. I have output in xml file format. It[/color]
                looks[color=blue]
                > like this:
                >
                > <P1JoyUp>
                > <Top>326</Top>
                > <Left>54</Left>
                > <Height>23</Height>
                > <Width>100</Width>
                > <Visible>True </Visible>
                > <ForeColor>Colo r [White]</ForeColor>
                > <BackColor>Colo r [Transparent]</BackColor>
                > <Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3,
                > GdiCharSet=0, GdiVerticalFont =False]</Font>
                > </P1JoyUp>
                >
                > I write it out and read it in using a data set. Now when I read it in I[/color]
                need[color=blue]
                > to convert the forecolor and backcolor strings to[/color]
                system.drawing. something.[color=blue]
                > WHere do I need to look for an answer.
                >
                > Thanks,
                > John
                >
                >[/color]


                Comment

                • Herfried K. Wagner [MVP]

                  #9
                  Re: Convert String to COlor

                  * "jcrouse" <john.crouse@co mcast.net> scripsit:[color=blue]
                  > I decided to start a new thread. I have output in xml file format. It looks
                  > like this:
                  >
                  > <P1JoyUp>
                  > <Top>326</Top>
                  > <Left>54</Left>
                  > <Height>23</Height>
                  > <Width>100</Width>
                  > <Visible>True </Visible>
                  > <ForeColor>Colo r [White]</ForeColor>
                  > <BackColor>Colo r [Transparent]</BackColor>
                  > <Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3,
                  > GdiCharSet=0, GdiVerticalFont =False]</Font>
                  > </P1JoyUp>
                  >
                  > I write it out and read it in using a data set. Now when I read it in I need
                  > to convert the forecolor and backcolor strings to system.drawing. something.
                  > WHere do I need to look for an answer.[/color]

                  \\\
                  Me.BackColor = Color.FromName( "Rosybrown" )
                  ///

                  - or -

                  \\\
                  Dim ColorName As String = ...
                  Me.Label1.BackC olor = Color.FromKnown Color(DirectCas t([Enum].Parse(GetType( KnownColor), ColorName), KnownColor))
                  ///

                  --
                  Herfried K. Wagner [MVP]
                  <URL:http://dotnet.mvps.org/>

                  Comment

                  • jcrouse

                    #10
                    Re: Convert String to COlor

                    Another problem. I had this working about two days ago. What am I missing
                    here. Here is how I write out to the xml file:

                    Dim dr1 As DataRow = ds.Tables("P1Jo yUp").NewRow

                    dr1("Top") = lblP1JoyUp.Top. ToString

                    dr1("Left") = lblP1JoyUp.Left .ToString

                    dr1("Height") = lblP1JoyUp.Heig ht.ToString

                    dr1("Width") = lblP1JoyUp.Widt h.ToString

                    dr1("Visible") = lblP1JoyUp.Visi ble.ToString

                    dr1("FontName") = lblP1JoyUp.Font .Name.ToString

                    dr1("FontSize") = lblP1JoyUp.Font .Size.ToString

                    dr1("FontBold") = lblP1JoyUp.Font .Bold.ToString

                    dr1("FontItalic ") = lblP1JoyUp.Font .Italic.ToStrin g

                    Here is what the xml file looks like:

                    <CPViewer>

                    <P1JoyUp>

                    <Top>10</Top>

                    <Left>10</Left>

                    <Height>23</Height>

                    <Width>100</Width>

                    <Visible>Fals e</Visible>

                    <ForeColor>Colo r [White]</ForeColor>

                    <BackColor>Colo r [Transparent]</BackColor>

                    <FontName>Micro soft Sans Serif</FontName>

                    <FontSize>8.2 5</FontSize>

                    <FontBold>False </FontBold>

                    <FontItalic>Fal se</FontItalic>

                    </P1JoyUp>


                    But now when I try to handle the font components individually it underlines
                    the four font line and says "font.xxxx property is read only. Here is the
                    code for reading the xml file back in:

                    If OpenFileDialog1 .FileName <> "" Then

                    Dim ds As New DataSet

                    ds.ReadXml(Open FileDialog1.Fil eName)

                    lblP1JoyUp.Top = ds.Tables(0).Ro ws(0).Item(0).T oString

                    lblP1JoyUp.Left = ds.Tables(0).Ro ws(0).Item(1).T oString

                    lblP1JoyUp.Heig ht = ds.Tables(0).Ro ws(0).Item(2).T oString

                    lblP1JoyUp.Widt h = ds.Tables(0).Ro ws(0).Item(3).T oString

                    lblP1JoyUp.Visi ble = ds.Tables(0).Ro ws(0).Item(4).T oString

                    lblP1JoyUp.Font .Name = ds.Tables(0).Ro ws(0).Item(7).T oString

                    lblP1JoyUp.Font .Size = ds.Tables(0).Ro ws(0).Item(8).T oString

                    lblP1JoyUp.Font .Bold = ds.Tables(0).Ro ws(0).Item(9).T oString

                    lblP1JoyUp.Font .Italic = ds.Tables(0).Ro ws(0).Item(10). ToString

                    lblP1JoyUp.Text = lblP1JoyUp.Name


                    Like I said, this worked a few days ago but I can't figure it out now. Do I
                    need to ".ToString" when I am reading back in?

                    Thanks,
                    John



                    "Cor Ligthert" <notfirstname@p lanet.nl> wrote in message
                    news:ejKlEsEUEH A.704@TK2MSFTNG P09.phx.gbl...[color=blue]
                    > Hi John,
                    >
                    > It is possible with that string to extract it using a regex, a split or an
                    > indexof or any combination of that.
                    >
                    > However much easier is just to save the components of the font seperatly[/color]
                    in[color=blue]
                    > your XML file
                    > (I showed you it the way you did to make it not that difficult explaining[/color]
                    it[color=blue]
                    > in a message, although I told that somewhere in a thread of you in this
                    > newsgroup)
                    >
                    > blablaFontName = textbox1.font.n ame.tostring
                    > blablaFondSize = textbox1.font.s ize.tostring
                    > etc.
                    >
                    > Than setting it back is much easier
                    > textbox1.font = new font(blablaFont Name, csng(blablaFont Size))
                    >
                    > I hope this helps?
                    >
                    > Cor
                    >
                    >[/color]


                    Comment

                    • jcrouse

                      #11
                      Re: Convert String to COlor

                      Well, this seems nice and simple. However, if you look at the xml file, the
                      color is specified as "Color [White]" and I only need the part between the
                      braces. If I modify the xml by hand and strip out everything but the actual
                      color name, this works great. So, in order to use this method, how do I
                      write JUST the color as a strin to the xml file.

                      Thanks,
                      John


                      "One Handed Man ( OHM#)" <news.microsoft .com> wrote in message
                      news:ODCY1xEUEH A.4048@TK2MSFTN GP12.phx.gbl...[color=blue]
                      > Color.FromName( "White")
                      >
                      > OHM
                      >
                      > "jcrouse" <john.crouse@co mcast.net> wrote in message
                      > news:uTtokEDUEH A.2408@tk2msftn gp13.phx.gbl...[color=green]
                      > > I decided to start a new thread. I have output in xml file format. It[/color]
                      > looks[color=green]
                      > > like this:
                      > >
                      > > <P1JoyUp>
                      > > <Top>326</Top>
                      > > <Left>54</Left>
                      > > <Height>23</Height>
                      > > <Width>100</Width>
                      > > <Visible>True </Visible>
                      > > <ForeColor>Colo r [White]</ForeColor>
                      > > <BackColor>Colo r [Transparent]</BackColor>
                      > > <Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3,
                      > > GdiCharSet=0, GdiVerticalFont =False]</Font>
                      > > </P1JoyUp>
                      > >
                      > > I write it out and read it in using a data set. Now when I read it in I[/color]
                      > need[color=green]
                      > > to convert the forecolor and backcolor strings to[/color]
                      > system.drawing. something.[color=green]
                      > > WHere do I need to look for an answer.
                      > >
                      > > Thanks,
                      > > John
                      > >
                      > >[/color]
                      >
                      >[/color]


                      Comment

                      • jcrouse

                        #12
                        Re: Convert String to COlor

                        I also like this method. It is easy to write to the xml file with this
                        method. Here is a sample:

                        <CPViewer>

                        <P1JoyUp>

                        <Top>136</Top>

                        <Left>99</Left>

                        <Height>23</Height>

                        <Width>100</Width>

                        <Visible>True </Visible>

                        <ForeColor>-256</ForeColor>

                        <BackColor>-16777216</BackColor>

                        <FontName>Micro soft Sans Serif</FontName>

                        <FontSize>8.2 5</FontSize>

                        <FontBold>False </FontBold>

                        <FontItalic>Fal se</FontItalic>

                        </P1JoyUp>


                        However, I can't get the code right to read it back in. This is what I
                        tried, amoungst many other syntaxes:

                        If OpenFileDialog1 .FileName <> "" Then

                        Dim ds As New DataSet

                        ds.ReadXml(Open FileDialog1.Fil eName)

                        lblP1JoyUp.Top = ds.Tables(0).Ro ws(0).Item(0).T oString

                        lblP1JoyUp.Left = ds.Tables(0).Ro ws(0).Item(1).T oString

                        lblP1JoyUp.Heig ht = ds.Tables(0).Ro ws(0).Item(2).T oString

                        lblP1JoyUp.Widt h = ds.Tables(0).Ro ws(0).Item(3).T oString

                        lblP1JoyUp.Visi ble = ds.Tables(0).Ro ws(0).Item(4).T oString

                        lblP1JoyUp.Fore Color.FromArgb( ds.Tables(0).Ro ws(0).Item(5))

                        lblP1JoyUp.Back Color.FromArgb( ds.Tables(0).Ro ws(0).Item(6))



                        Any idea on the reading part,

                        John




                        "J M" <a@b.com> wrote in message
                        news:%23eL%23LZ FUEHA.4048@TK2M SFTNGP12.phx.gb l...[color=blue]
                        > I always use Color.ToARGB to write, and
                        > Color.FromARGB to read them back again.
                        > I think that's much easier to do...
                        >
                        > Hope I helped,
                        >
                        >
                        > J Mous
                        >
                        > "jcrouse" <john.crouse@co mcast.net> schreef in bericht
                        > news:uTtokEDUEH A.2408@tk2msftn gp13.phx.gbl...[color=green]
                        > > I decided to start a new thread. I have output in xml file format. It[/color]
                        > looks[color=green]
                        > > like this:
                        > >
                        > > <P1JoyUp>
                        > > <Top>326</Top>
                        > > <Left>54</Left>
                        > > <Height>23</Height>
                        > > <Width>100</Width>
                        > > <Visible>True </Visible>
                        > > <ForeColor>Colo r [White]</ForeColor>
                        > > <BackColor>Colo r [Transparent]</BackColor>
                        > > <Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3,
                        > > GdiCharSet=0, GdiVerticalFont =False]</Font>
                        > > </P1JoyUp>
                        > >
                        > > I write it out and read it in using a data set. Now when I read it in I[/color]
                        > need[color=green]
                        > > to convert the forecolor and backcolor strings to[/color]
                        > system.drawing. something.[color=green]
                        > > WHere do I need to look for an answer.
                        > >
                        > > Thanks,
                        > > John
                        > >
                        > >[/color]
                        >
                        >[/color]


                        Comment

                        • jcrouse

                          #13
                          Re: Convert String to COlor

                          Ken......I tried your method also and failed. Read the reply above to OHM
                          for my attempt and results at your first recommendation. As for your second
                          recommendation, I don't understand the "..." at the end of the first line.

                          Please elaborate more,

                          John

                          "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
                          news:uNATMAGUEH A.4064@TK2MSFTN GP11.phx.gbl...[color=blue]
                          > * "jcrouse" <john.crouse@co mcast.net> scripsit:[color=green]
                          > > I decided to start a new thread. I have output in xml file format. It[/color][/color]
                          looks[color=blue][color=green]
                          > > like this:
                          > >
                          > > <P1JoyUp>
                          > > <Top>326</Top>
                          > > <Left>54</Left>
                          > > <Height>23</Height>
                          > > <Width>100</Width>
                          > > <Visible>True </Visible>
                          > > <ForeColor>Colo r [White]</ForeColor>
                          > > <BackColor>Colo r [Transparent]</BackColor>
                          > > <Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3,
                          > > GdiCharSet=0, GdiVerticalFont =False]</Font>
                          > > </P1JoyUp>
                          > >
                          > > I write it out and read it in using a data set. Now when I read it in I[/color][/color]
                          need[color=blue][color=green]
                          > > to convert the forecolor and backcolor strings to[/color][/color]
                          system.drawing. something.[color=blue][color=green]
                          > > WHere do I need to look for an answer.[/color]
                          >
                          > \\\
                          > Me.BackColor = Color.FromName( "Rosybrown" )
                          > ///
                          >
                          > - or -
                          >
                          > \\\
                          > Dim ColorName As String = ...
                          > Me.Label1.BackC olor =[/color]
                          Color.FromKnown Color(DirectCas t([Enum].Parse(GetType( KnownColor),
                          ColorName), KnownColor))[color=blue]
                          > ///
                          >
                          > --
                          > Herfried K. Wagner [MVP]
                          > <URL:http://dotnet.mvps.org/>[/color]


                          Comment

                          • Herfried K. Wagner [MVP]

                            #14
                            Re: Convert String to COlor

                            * "jcrouse" <me> scripsit:[color=blue]
                            > Ken......I tried your method also and failed. Read the reply above to OHM
                            > for my attempt and results at your first recommendation. As for your second
                            > recommendation, I don't understand the "..." at the end of the first line.[/color]

                            Just replace it with a string that contains the name of the color, for
                            example, "Red".

                            --
                            Herfried K. Wagner [MVP]
                            <URL:http://dotnet.mvps.org/>

                            Comment

                            • Ken Tucker [MVP]

                              #15
                              Re: Convert String to COlor

                              Hi,

                              Dim strColor As String = "Color [White]"
                              Dim l As Integer = strColor.IndexO f("[")
                              Dim r As Integer = strColor.IndexO f("]")
                              Dim strFormatedColo r As String = strColor.Substr ing(l + 1, r - l
                              - 1)
                              Dim clrBack As Color = Color.FromName( strFormatedColo r)

                              Me.BackColor = clrBack

                              Ken
                              --------------------

                              "jcrouse" <me> wrote in message
                              news:ebeZAzKUEH A.644@tk2msftng p13.phx.gbl:[color=blue]
                              > Ken......I tried your method also and failed. Read the reply above to OHM
                              >
                              > for my attempt and results at your first recommendation. As for your
                              > second
                              > recommendation, I don't understand the "..." at the end of the first
                              > line.
                              >
                              > Please elaborate more,
                              >
                              > John
                              >
                              > "Herfried K. Wagner [MVP]" <HYPERLINK
                              > "mailto:hir f-spam-me-here@gmx.at"hir f-spam-me-here@gmx.at> wrote in message
                              >
                              > news:uNATMAGUEH A.4064@TK2MSFTN GP11.phx.gbl...
                              >[color=green]
                              > > * "jcrouse" <HYPERLINK
                              > > "mailto:john.cr ouse@comcast.ne t"john.crouse@c omcast.net> scripsit:[/color]
                              >[color=green][color=darkred]
                              > > > I decided to start a new thread. I have output in xml file format.
                              > > > It[/color][/color]
                              >
                              > looks
                              >[color=green][color=darkred]
                              > > > like this:
                              > > >
                              > > > <P1JoyUp>
                              > > > <Top>326</Top>
                              > > > <Left>54</Left>
                              > > > <Height>23</Height>
                              > > > <Width>100</Width>
                              > > > <Visible>True </Visible>
                              > > > <ForeColor>Colo r [White]</ForeColor>
                              > > > <BackColor>Colo r [Transparent]</BackColor>
                              > > > <Font>[Font: Name=Microsoft Sans Serif, Size=8.25, Units=3,
                              > > > GdiCharSet=0, GdiVerticalFont =False]</Font>
                              > > > </P1JoyUp>
                              > > >
                              > > > I write it out and read it in using a data set. Now when I read it in
                              > > > I[/color][/color]
                              >
                              > need
                              >[color=green][color=darkred]
                              > > > to convert the forecolor and backcolor strings to[/color][/color]
                              >
                              > system.drawing. something.
                              >[color=green][color=darkred]
                              > > > WHere do I need to look for an answer.[/color]
                              > >[/color]
                              >[color=green]
                              > > \\\
                              > > Me.BackColor = Color.FromName( "Rosybrown" )
                              > > ///
                              > >
                              > > - or -
                              > >
                              > > \\\
                              > > Dim ColorName As String = ...
                              > > Me.Label1.BackC olor =[/color]
                              >
                              > Color.FromKnown Color(DirectCas t([Enum].Parse(GetType( KnownColor),
                              > ColorName), KnownColor))
                              >[color=green]
                              > > ///
                              > >
                              > > --
                              > > Herfried K. Wagner [MVP]
                              > > <URL:http://dotnet.mvps.org/>[/color]
                              >[/color]

                              --
                              Outgoing mail is certified Virus Free.
                              Checked by AVG Anti-Virus (http://www.grisoft.com).
                              Version: 7.0.230 / Virus Database: 263.1.2 - Release Date: 6/7/2004


                              Comment

                              Working...