Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Event

Event

Scheduled Pinned Locked Moved C#
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    abalfazl
    wrote on last edited by
    #1

    Hello friends namespace calculate { public delegate void Startdelegate(); public partial class Form1 : Form { // custom event public event Startdelegate StartEvent; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { int result = int.Parse(num1.Text) / int.Parse(num2.Text); MessageBox.Show(result.ToString()); } private void button2_Click(object sender, EventArgs e) { int result = int.Parse(num1.Text) + int.Parse(num2.Text); TextBox3.Text = result.ToString(); } private void button3_Click(object sender, EventArgs e) { int result = int.Parse(num1.Text) * int.Parse(num2.Text); MessageBox.Show(result.ToString()); } // our custom "Startdelegate" delegate is assigned // to our custom "StartEvent" event. StartEvent += new Startdelegate(OnStartEvent); public void OnStartEvent() { MessageBox.Show("I Just Started!"); } I want when the for calculation be open,Another window will be open with this maassage : " It is started" I want to do this by delegation... GOOD LUCK!

    B 1 Reply Last reply
    0
    • A abalfazl

      Hello friends namespace calculate { public delegate void Startdelegate(); public partial class Form1 : Form { // custom event public event Startdelegate StartEvent; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { int result = int.Parse(num1.Text) / int.Parse(num2.Text); MessageBox.Show(result.ToString()); } private void button2_Click(object sender, EventArgs e) { int result = int.Parse(num1.Text) + int.Parse(num2.Text); TextBox3.Text = result.ToString(); } private void button3_Click(object sender, EventArgs e) { int result = int.Parse(num1.Text) * int.Parse(num2.Text); MessageBox.Show(result.ToString()); } // our custom "Startdelegate" delegate is assigned // to our custom "StartEvent" event. StartEvent += new Startdelegate(OnStartEvent); public void OnStartEvent() { MessageBox.Show("I Just Started!"); } I want when the for calculation be open,Another window will be open with this maassage : " It is started" I want to do this by delegation... GOOD LUCK!

      B Offline
      B Offline
      b0ksah
      wrote on last edited by
      #2

      Why not use the Load event on a form for this?

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups