0
在記事本中,在編輯菜單下有一個Goto按鈕來移動到特定行。我試圖在VB 6.0中對此進行編碼,但它不起作用。代碼如下所示在vb 6.0中如何移動到特定行
Private sub goto_click()
Dim s As String
s = InputBox("enter line number")
If IsNumeric(s) = True Then
RichTextBox1.SelStart = RichTextBox1.GetLineFromChar(s - 1)
RichTextBox1.Move (s)
RichTextBox1.SetFocus
End If
End Sub
不,它不起作用它給第一行編譯錯誤,因爲常量固定長度字符串和聲明語句不允許作爲對象模塊的公共成員。我把它作爲私人,但它再次給出錯誤類型不匹配在私人sub goto_click – user2971979
什麼是錯誤? –
您可能需要將這兩個「Public」更改爲「Private」。 –