Doubt about the Messagebox

Asked

Viewed 150 times

0

I have a question about our famous MessageBox.Show();, this command is an event, method what would be??

Another question is about instantiating object, in the example below we are taking our login form and creating a variable that will be our object reference = receive object frmLogin.

My question is, can I say that my object would be frmLogin or entra

frmLogin entra = new frmLogin()

entra.show();

1 answer

2

  • The MessageBoxis a public class of namespace System.Windows.Forms{};
  • The .Show() is a static method of the Messagebox class that has as the return type a Dialogresult;

You can view this information in Metadata in the Visual Studio IDE by selecting the method or class name and pressing the key F12 (Ir para definições):

inserir a descrição da imagem aqui

More About MessageBox: Class Documentation


In the case:

frmLogin entra = new frmLogin()
entra.Show();

entra is an object that refers to classe parcial frmLogin that has as base a classe pública Form. In this situation the object will be instantiated and then invoked the Method .Show() that has as function display control(Form).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.