[ad_1]
I have a set of custom controls from a DLL that I’ve added to the toolbox, but I am seeing some strange behavior with the color properties not working as expected. Specifically, the designer code shows one thing, while the GUI properties list shows something contradictory.
Declaration in .Designer.vb:
Me.ExButton1 = New ExtelliorGUI.ExButton()
Later, in .Designer.vb file:
'ExButton1
'
Me.ExButton1.BackColor = System.Drawing.Color.Transparent
Me.ExButton1.BorderRadius = 0
Me.ExButton1.BorderSize = 1
Me.ExButton1.Design = ExtelliorGUI.ButtonDesign.Normal
Me.ExButton1.FlatAppearance.BorderSize = 0
Me.ExButton1.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(240, Byte), Integer), CType(CType(240, Byte), Integer), CType(CType(240, Byte), Integer))
Me.ExButton1.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
Me.ExButton1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.ExButton1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.5!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.ExButton1.ForeColor = System.Drawing.Color.DarkOrchid
Me.ExButton1.IconChar = FontAwesome.Sharp.IconChar.CaretSquareRight
Me.ExButton1.IconColor = System.Drawing.Color.DarkOrchid
Me.ExButton1.IconFont = FontAwesome.Sharp.IconFont.[Auto]
Me.ExButton1.IconSize = 24
Me.ExButton1.Location = New System.Drawing.Point(390, 224)
Me.ExButton1.Name = "ExButton1"
Me.ExButton1.Size = New System.Drawing.Size(97, 40)
Me.ExButton1.SkinBorderColor = System.Drawing.Color.DarkOrchid
Me.ExButton1.Style = ExtelliorGUI.ControlStyle.Glass
Me.ExButton1.TabIndex = 24
Me.ExButton1.Text = "Build"
Me.ExButton1.TextAlign = System.Drawing.ContentAlignment.MiddleRight
Me.ExButton1.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage
Me.ExButton1.UseVisualStyleBackColor = False
In particular, note:
Me.ExButton1.SkinBorderColor = System.Drawing.Color.DarkOrchid
I didn’t modify that code; the designer put it there.
And yet in the GUI property list, I see something totally different:
What the GUI shows for the colors is completely different than .Designer.VB.
Further:
-
When I copy paste one of the custom controls, it doesn’t copy the color settings. Instead, it creates the copy with default colors.
-
Seemingly randomly, sometimes the color settings revert to their defaults.
-
I can adjust them in the GUI, and the change seems to be preserved at first, but it seems than I do something that might cause refactoring etc., that’s when my changes seem to get lost.
-
This morning, when I opened my Solution, I also noticed that the Toolbox section where I had added the custom controls vanished. It was like it was never there. I created a new section, browsed to the DLL and added the items, which seemed to “stick” through one close/re-open, but there’s something crazy going on here I can’t explain.
What could cause this to get out of sync or cause these particular properties to get “lost”?
[ad_2]