Defaults are not Resetting to the correct values. I have the default attributes on each of the
three properties but when I reset them it goes to Horizontal, 0, 0 and not ForwardDiagonal, White, Blue.
Do I need to supply something different as a default since the prop is expandable?
The gradient panel is not respondin at all to the property changes.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Re: Expandable Properties - Almost Solved but still a few "issues"
Ok, now I get some kind of hex number for RGB colors?
"ForwardDiagonal, ff7ba2e7, ff6375d6"
I am trying to get the Reset right click context menu to function at the DrawStyles level just like it does
for the Font property. The Font property lets you reset all the child properties at the top level with one
click.
I have the GradientMode, PanelColor1, and PanelColor2 all with the DefaultValues attrib, so I dont know
what else to do to fix it?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Re: Expandable Properties - Almost Solved but still a few "issues"
VB Code:
Public Overloads Overrides Function ConvertTo(ByVal context As ITypeDescriptorContext, ByVal culture As CultureInfo, ByVal value As Object, ByVal destType As Type) As Object
If destType Is GetType(String) Then
' Attempt to convert the value into a string representation
Try
Dim styles As DrawStyles = CType(value, DrawStyles)
The problem with the colors displaying as hex should be on the bold line.
-----
Default values:
VB Code:
Public Overloads Overrides Function ConvertFrom(ByVal context As ITypeDescriptorContext, ByVal culture As CultureInfo, ByVal value As Object) As Object
If value.GetType() Is GetType(String) Then
[b]If IsNothing(Value) OrElse DirectCast(Value,String).Text.Length = 0 Then
Dim x as New DrawStyles
x.DrawMode = Vertical
x.Color1 = Color.White
x.Color2 = Color.Blue
Return x
End If[/b]
Try
' Attempt to parse the string representation
' into the constituent properties
Dim ds As New DrawStyles
Dim s As String = value
Dim c As String
Dim props As String() = s.Split(",".ToCharArray())
Re: Expandable Properties - Almost Solved but still a few "issues"
Cool getting even closer. But the top level prop only reset if I delete the concatinated string, but then it
reset correctly. When I reset the top level prop it resets to horizontal, 0, 0 and not my custom defaults I
added to each of the three child props. Do I need to add the defaults to the top level mailn prop too? Idf so
then how since you cant have more then one?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.