Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adjusting namespace of controls
Message
From
25/07/2013 10:57:38
 
 
To
All
General information
Forum:
ASP.NET
Category:
Forms
Title:
Adjusting namespace of controls
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01579209
Message ID:
01579209
Views:
59
I have a form which I moved at the framework level. This is like that since a few years. I never had to change something in it since today. In my framework, I have a Classes.vb file which contains controls for the forms. They are like this:
Imports System.Windows.Forms
Imports System.Drawing

<ToolboxBitmap(GetType(Label))> _
Public Class LXLabel
    Inherits System.Windows.Forms.Label

    Public Sub New()
        FlatStyle = Windows.Forms.FlatStyle.System
    End Sub

End Class

<ToolboxBitmap(GetType(LinkLabel))> _
Public Class LXLinkLabel
    Inherits System.Windows.Forms.LinkLabel

    Public Sub New()
        FlatStyle = Windows.Forms.FlatStyle.System
    End Sub

End Class

<ToolboxBitmap(GetType(Button))> _
Public Class LXButton
    Inherits System.Windows.Forms.Button

    Public Sub New()
        FlatStyle = Windows.Forms.FlatStyle.System
    End Sub

End Class

<ToolboxBitmap(GetType(TextBox))> _
Public Class LXTextBox
    Inherits System.Windows.Forms.TextBox

    Public Sub New()
    End Sub

End Class

<ToolboxBitmap(GetType(CheckBox))> _
Public Class LXCheckbox
    Inherits System.Windows.Forms.CheckBox

    Public Sub New()
        FlatStyle = Windows.Forms.FlatStyle.System
    End Sub

End Class

<ToolboxBitmap(GetType(RadioButton))> _
Public Class LXRadioButton
    Inherits System.Windows.Forms.RadioButton

    Public Sub New()
        FlatStyle = Windows.Forms.FlatStyle.System
    End Sub

End Class

<ToolboxBitmap(GetType(GroupBox))> _
Public Class LXGroupBox
    Inherits System.Windows.Forms.GroupBox

    Public Sub New()
        FlatStyle = Windows.Forms.FlatStyle.System
    End Sub

End Class

<ToolboxBitmap(GetType(PictureBox))> _
Public Class LXPictureBox
    Inherits System.Windows.Forms.PictureBox

    Public Sub New()
    End Sub

End Class

<ToolboxBitmap(GetType(ListBox))> _
Public Class LXListBox
    Inherits System.Windows.Forms.ListBox

    Public Sub New()
    End Sub

End Class

<ToolboxBitmap(GetType(CheckedListBox))> _
Public Class LXCheckedListBox
    Inherits System.Windows.Forms.CheckedListBox

    Public Sub New()
    End Sub

End Class

<ToolboxBitmap(GetType(ComboBox))> _
Public Class LXComboBox
    Inherits System.Windows.Forms.ComboBox

    Public Sub New()
    End Sub

End Class

<ToolboxBitmap(GetType(TabControl))> _
Public Class LXTabControl
    Inherits System.Windows.Forms.TabControl

    Public Sub New()
    End Sub

End Class

<ToolboxBitmap(GetType(NumericUpDown))> _
Public Class LXNumericUpDown
    Inherits System.Windows.Forms.NumericUpDown

    Public Sub New()
    End Sub

End Class

Public Class LXTabPage
    Inherits System.Windows.Forms.TabPage

    Public Sub New()
    End Sub

End Class
Then, in a Robot form, in the framework, I have 10 controls. They are all bound on those controls. I have done numerous compilations since then and never had any problem. However, as soon as I went today in the Robot form and adjusted a property of a control, I started to get a bunch of errors which corresponds to the number of controls I have. The reason is before I moved the Robot form at the framework level, all controls were referenced as Framework.LXTabControl, Framework.LXButton and so on. Now, as they are at the framework level, this Framework reference has to be dropped from the control reference. Because, as soon as I change something, the design detects that and complains. So, I can go in the code and change the control instantiation lines to remove the "Framework." reference to this:
            Me.TabControl1 = New LXTabControl
            Me.TabPage1 = New LXTabPage
            Me.GroupBox2 = New LXGroupBox
            Me.Status = New LXTextBox
            Me.LxPictureBox1 = New LXPictureBox
            Me.Button3 = New LXButton
            Me.Button2 = New LXButton
            Me.PictureBox2 = New LXPictureBox
This allows me to compile. But, as soon as I go back at the form and change another property, the "Framework." gets added in front of all those controls.

I see that this seems to come that from the designer property window, I can see that all those controls are still referenced as Framework.LXTabControl, Framework.LXTabPage and so on. I am not able to find a way to adjust that. How can this be adjusted?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform