Generated Designer code questions


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
I understand...glad you asked Smile
Michael Cobb
Michael Cobb
StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)
Group: Forum Members
Posts: 26, Visits: 1K
Thanks Trent.  I suspected it would be ok to manually modify the designer code but didn't want to waste time doing so if others hadn't blazed the trail before me without problems. Wink
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
1. Is there a way to force the generated code to update short of deleting all of the labels I copied and pasted and recreating them within the new form?

No.  You have to "smoke-it" and add it back. (That is Texan for delete BigGrin)

2. What are the potential negatives if I were to modify the designer code myself so that the controls I copied and pasted are coded in the designer.vb file the same way as the one I created that was new?

Not really.  This is something that we end-up doing all of the time.  The properties may be reserialized once modified through the designer, but if you have enough understanding of how the InitializeComponent of the form works (which you do it sounds like) then go for it!

Michael Cobb
Michael Cobb
StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)StrataFrame Beginner (26 reputation)
Group: Forum Members
Posts: 26, Visits: 1K
I have a StrataFrame form I'm working on that is similar to a standard windows form.  I copied all of the labels from the original windows form and pasted them onto the StrataFrame form and then dropped new StrataFrame controls where needed.  I wanted to code some events for the controls I copied and pasted.  When I looked in the code window in the class name drop down for these label controls they didn't appear.  Upon reviewing the form.designer.vb code for this form, I noticed that none of these labels have a Friend WithEvents entry, and all of them have a dim labelname as System.Windows.Forms.Label entry in the InitializeComponent sub.  I tried doing a clean build, rebuild and build solution, but the designer generated code for these controls did not change.

A label that I copied from the other form and pasted onto the new one gets these lines of code generated in the initialize component:

   Dim Label1 As System.Windows.Forms.Label
   
   Label1 = New System.Windows.Forms.Label
   
   'Label1
   '
   Label1.AutoSize = True
   Label1.Location = New System.Drawing.Point(48, 30)
   Label1.Name = "Label1"
   Label1.Size = New System.Drawing.Size(42, 13)
   Label1.TabIndex = 107
   Label1.Text = "Facility:"
   
   Me.PropertyInformationThemedPanel.Controls.Add(Label1)

while a label I created gets these lines in the initialize component:

   Me.Label21 = New System.Windows.Forms.Label
   
   Me.PropertyInformationThemedPanel.Controls.Add(Me.Label21)
   
   'Label21
   '
   Me.Label21.AutoSize = True
   Me.Label21.Location = New System.Drawing.Point(540, 11)
   Me.Label21.Name = "Label21"
   Me.Label21.Size = New System.Drawing.Size(16, 13)
   Me.Label21.TabIndex = 137
   Me.Label21.Text = "---"

plus the aforementioned WithEvents line: 

   Friend WithEvents Label21 As System.Windows.Forms.Label

1. Is there a way to force the generated code to update short of deleting all of the labels I copied and pasted and recreating them within the new form?

2. What are the potential negatives if I were to modify the designer code myself so that the controls I copied and pasted are coded in the designer.vb file the same way as the one I created that was new?

Any advice would be greatly appreciated.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search