2013-03-20 50 views
-2

遇到问题我遇到了messagebox.show的问题。我想要答案和这一行“你想尝试另一次临时转换吗?”出现在带有yesno按钮的消息框中。使用messagebox.show

MessageBox.Show(intFah.ToString & ControlChars.CrLf & "Would you like to start another temp conversion?", MessageBoxButtons.YesNo) 

你不及格的parameters权数:因为在你的MessageBox.Show它可能 -

Public Class Form1 
    Dim intFah As Windows.Forms.DialogResult 

    Private Sub BtnFah_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnFah.Click 
     Try 
      Dim intFah As Integer 

      intFah = CInt(TxtBoxTemp.Text) 
      intFah = (intFah * 9)/5 - 32 
      MessageBox.Show(intFah.ToString & ControlChars.CrLf & "Would you like to start another temp conversion?", MessageBoxButtons.YesNo) 
     Catch 
      MessageBox.Show("Would you like to start another temp conversion?", "System Error", MessageBoxButtons.YesNo) 

     End Try 
    End Sub 
End Class 
+0

使用返回值。 – 2013-03-20 02:38:41

回答

1

您的代码没有建立适合我。按照该链接,它需要的文字,标题(标题),然后按钮选项

如果我将其更改为:

MessageBox.Show(intFah.ToString & ControlChars.CrLf & "Would you like to start another temp conversion?", "A Caption", MessageBoxButtons.YesNo) 

然后它建立并当我运行的应用程序,我可以得到答案出现在一行,文本在第二行,根据你的要求。

+0

谢谢!现在正在工作。现在我只需确保消息框上的按钮正常工作。 – user2189046 2013-03-20 02:44:23

相关问题