“表单"问题数据类型

“表单

问题描述:

亲爱的朋友,

我在类库项目中有以下代码:

dear friends,

i have the following code in a class library project:

Public Sub SetAllTextBoxesLanguage(ByVal CurrentForm As form)

      Dim MyFont As System.Drawing.Font

      Select Case InputMethod
          Case "Unicode"
              For Each MyControl As Control In CurrentForm.Controls
                  If TypeOf MyControl Is TextBox Then
                      MyFont = MyControl.Font
                      MyControl.Font = New Font(MyFont.Name, MyFontSize, FontStyle.Regular)
                  End If
              Next
          Case "NonUnicode"
              For Each MyControl As Control In CurrentForm.Controls
                  If TypeOf MyControl Is TextBox Then
                      MyControl.Font = New Font(MyFontName, MyFontSize, FontStyle.Regular)
                  End If
              Next
      End Select
  End Sub



但是它显示表单"和控件"类型的错误.
你能告诉我这里是什么问题吗?

问候
SKPaul



But it shows error with the type "form" and "Control".
Would you please tell me what is the problem here?

Regards
SKPaul

那又是什么错误?我们要猜吗?
无论如何,仅凭猜测,您是否在应用程序中引用了System.Windows.Forms?在班级顶部尝试Import System.Windows.Forms.
And what error? Do we have to guess?
Anyways, just a guess, do you have reference to System.Windows.Forms in your application? Try Import System.Windows.Forms at the top of your class.