Beruflich Dokumente
Kultur Dokumente
Create a form Name it as frmContextMenu with caption on your form Context Menu Add a ContextMenuStrip component at your toolbox Type &Color for the 1st menu item, &Font for the 2nd menu item and E&xit for the 3rd menu item
Add a lblMessage to your form and set the Text property to Right Click for the Context Menu Set the forms property to Context Menu Property to ContextMenuStrip1. Add a ColorDialog and Font Dialog component to the form
Create your own context menu by putting OpenFileDialog and SaveFileDialog. Lets try and enjoy the journey
To create input Box you must put a button and write the code as given below: declare variable to get the value from inputbox Dim nama As String assign variable with input box nama = InputBox("Masukkan Nama Anda", "Input Nama") display message at lblmessage using variable from the input box lblMessage.Text = "Nama anda ialah " & nama
Create a
Before creating a Message Box you must create a button and write the code appropriately based on the example given.
MessageBox.Show(Text,Title) MessageBox.Show("Ini contoh untuk paparan mesej dan Tajuk", "Mesej") Output:
MessageBox.Show(Text,Title,Button) MessageBox.Show("Ini contoh untuk paparan mesej dan Tajuk dan Button Yes dan No","Mesej", MessageBoxButtons.YesNo) Output:
MessageBox.Show(Text,Title,Button,Icon) MessageBox.Show("Ini contoh untuk paparan mesej dan Tajuk dan Button OK dan CANCEL dan Icon Information", "Mesej", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) Output:
MessageBox Button
MessageBoxButtons.OK MessageBoxButtons.OKCancel MessageBoxButtons.YesNo MessageBoxButtons.YesNoCancel MessageBoxButtons.RetryCancel MessageBoxButtons.AbortRetryIgn ore
Output
MessageBox Button
MessageBoxIcon.Asterisk / MessageBoxIcon.Information / MessageBoxIcon.Stop MessageBoxIcon.Error / MessageBoxIcon.Warning MessageBoxIcon.Exclamation MessageBoxIcon.Question
Output
Write the code based on the output given using Message Box