![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Unverified User
Join Date: Jan 2007
Location: Estonia
Posts: 4
Rep Power: 0
![]() |
Function doesnt work!
I have a form and it got 2 buttons on...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public void MessageShow()
{
MessageBox.Show("Yo!"+Var1,"",MessageButton.OK);
}
private void button1_Click(object sender, EventArgs e)
{
MessageShow();
string Var1;
Var1 = @"Man";
}
private void button2_Click(object sender, EventArgs e)
{
MessageShow();
string Var1;
Var1 = @"Dude";
}
}
}If i click button1 then messagebox should popup with message "Yo! Man" but if i click button2 then there should be message "Yo! Dude". My problem is that this code example doesnt work. Maybe someone can direct me to right way. |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Combining languages | titaniumdecoy | Other Programming Languages | 12 | Jul 13th, 2006 3:03 PM |
| Compiling Maverik 6.2 (from C) | megamind5005 | C | 16 | May 3rd, 2006 6:41 PM |
| BH Hotkeys | brownhead | Visual Basic | 1 | Apr 27th, 2006 6:42 PM |
| libraries | matko | C | 1 | Jan 22nd, 2006 3:12 PM |
| Jackpot game | zorin | Visual Basic | 3 | Jun 10th, 2005 2:19 PM |