Re: Comparing Empty Value types
From: Jay B. Harlow [MVP - Outlook] (Jay_Harlow_MVP_at_msn.com)
Date: 11/17/04
- Next message: Manuel Ricca: "Re: how to display a web page (in windows application) from an html string ?"
- Previous message: Cor Ligthert: "Re: Forms or Modules"
- In reply to: Cor Ligthert: "Re: Comparing Empty Value types"
- Next in thread: Cor Ligthert: "Re: Comparing Empty Value types"
- Reply: Cor Ligthert: "Re: Comparing Empty Value types"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 17 Nov 2004 10:52:17 -0600
Cor,
> It was just an alternative, this one is not real very important for me,
Obviously I know its an alternative, Hopefully you noticed that I stated
last night it was an alternative & again just now.
Thanks for noticing.
Jay
"Cor Ligthert" <notmyfirstname@planet.nl> wrote in message
news:%23IeiyJMzEHA.2624@TK2MSFTNGP11.phx.gbl...
> Jay,
>
> It was just an alternative, this one is not real very important for me,
> however I like more evaluating for equality using the = operator than
> evaluating using a methode and with the color that is possible.
>
> But the "Is" in this functions tells it very good, therefore it is not
> really that important for me.
>
> However as I said, just an alternative.
>
> Cor
>
> "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP@msn.com>
>
>> Cor (& Herfried),
>> As I stated in my initial reply:
>>
>>> See the Color.Equals function in the online help for some important
>>> remarks about using Color.Equals and when you may want to use
>>> Color.ToArgb to compare two colors.
>>
>> If I want to compare what is visible seen I will use Color.ToArgb in
>> other words to compare the Alpha, Red, Green & Blue values.
>>
>> If I want to compare what is literally used I will use Color.Equals or
>> Color.op_Equality, in other words to compare the names of the color or
>> the values for unnamed colors.
>>
>> For example:
>>
>> Dim color1 As Color = Color.Black
>> Dim color2 As Color = Color.FromArgb(0,0,0)
>>
>> Both are visibly Black, however they are not logically the same value. In
>> other words:
>>
>> If color1.Equals(color2) Then
>> ' color1 is the same named color as color2
>> End If
>>
>> If color1.ToArgb() = color2.ToArgb() Then
>> ' color1 & color2 have the same Alpha, Red, Green & Blue values
>> End If
>>
>> Just a thought
>> Jay
>>
>>
>> "Cor Ligthert" <notmyfirstname@planet.nl> wrote in message
>> news:ulhANFIzEHA.2568@TK2MSFTNGP11.phx.gbl...
>>> Dennis,
>>>
>>> As alternative
>>> If mycolor.ToArgb = mycolor.Empty.ToArgb
>>>
>>> End if
>>>
>>> Cor
>>>
>>> "Dennis" <Dennis@discussions.microsoft.com>:
>>>>
>>>> public mycolor as color = color.Empty
>>>>
>>>> I want to check to see if the user has specified a color like;
>>>>
>>>> if mycolor = Color.Empty then.....
>>>> or
>>>> if mycolor is Color.Empty then .......
>>>>
>>>> I get errors saying that = can be used for colors and is can't be used
>>>> with
>>>> value types. I give up...how do I do this. Thanks.
>>>> --
>>>> Dennis in Houston
>>>
>>>
>>
>>
>
>
- Next message: Manuel Ricca: "Re: how to display a web page (in windows application) from an html string ?"
- Previous message: Cor Ligthert: "Re: Forms or Modules"
- In reply to: Cor Ligthert: "Re: Comparing Empty Value types"
- Next in thread: Cor Ligthert: "Re: Comparing Empty Value types"
- Reply: Cor Ligthert: "Re: Comparing Empty Value types"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|