|
-
Nov 28th, 2010, 02:37 PM
#1
Thread Starter
PowerPoster
[VB6] - property reciving a strange values, when is used
i have 1 property:
Code:
Public Property Get BorderSelectionColor() As OLE_COLOR
BorderSelectionColor = lngBorderSelectionColor
End Property
Public Property Let BorderSelectionColor(ByVal vNewValue As OLE_COLOR)
lngBorderSelectionColor = vNewValue
Call ShowImage
PropertyChanged "BorderSelectionColor"
End Property
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
BorderSelectionColor = PropBag.ReadProperty("BorderSelectionColor", 0)
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
PropBag.WriteProperty "BorderSelectionColor", BorderSelectionColor, 0
End Sub
i change the property value in project mode and is saved. the problem is that, when i use it, the value is negative. can anyone advice me?
-
Nov 28th, 2010, 08:45 PM
#2
Re: [VB6] - property reciving a strange values, when is used
Negative values are usually VB system colors (i.e., vbButtonFace for example).
To convert a VB system color to a valid RGB color, you can use the GetSystColor API. The color code to pass to that api are stored in the 1st byte of the VB system color:
Code:
RGBcolor = GetSysColor(lngBorderSelectionColor And &HFF&)
-
Nov 29th, 2010, 03:24 PM
#3
Thread Starter
PowerPoster
Re: [VB6] - property reciving a strange values, when is used
 Originally Posted by LaVolpe
Negative values are usually VB system colors (i.e., vbButtonFace for example).
To convert a VB system color to a valid RGB color, you can use the GetSystColor API. The color code to pass to that api are stored in the 1st byte of the VB system color:
Code:
RGBcolor = GetSysColor(lngBorderSelectionColor And &HFF&)
yes.. that's true.. thanks for the information. but for see working i delete the manifestment file(that file for give XP style in VB 6 IDE). then i can use the pallete colors and works fine
thanks for everything
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|