Usercontrol - own label problem

A

Agnes

I design my own lable and save as usercontrol , In my form (another project
myProject), i will use this usercontrol , however, it somestiems work fine
but somestimes fail.
now , I got a serious error (as i want to open myform) -[Could not find ny
resource appropriate for the specified culture (or the neutral culture) in
the give assembltyl Make sure the 'dtsclass.lable.resource' was corrected
assembly "myProject".......... Please help [i had remove, delete, rebuild
the usercontrol serveral times, but uselsess]

The following codes is my usercontrol 's code,

Imports System.Globalization
Imports System.Resources
Imports System.Threading
Imports System.Windows.Forms

Public Class stdlabel
Inherits System.Windows.Forms.Label
Public rmLabel As ResourceManager
Dim strFontName As New Drawing.Font("Courier New", 9)

Protected Overrides Sub InitLayout()
Me.AutoSize = True
Me.Font = New System.Drawing.Font("Courier New", 9)
End Sub

Public Overridable Function UISetting_label()
rmLabel = New ResourceManager("dtsclass.label",
System.Reflection.Assembly.GetExecutingAssembly())
Try
Me.Text = rmLabel.GetString(Me.Name)
Catch err As Exception
' MessageBox.Show(Me.Name)
End Try
End Function

End Class
 
C

Cor Ligthert

Agners,

Maybe you can start with setting in top of this ui

Option Strict On
Imports System.Globalization
Imports System.Resources
Imports System.Threading
Imports System.Windows.Forms

I think it will lead you furter

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top