Click here to Skip to main content
15,867,568 members
Home / Discussions / C#
   

C#

 
GeneralRe: Accessing Serial Port Remotely Pin
Member 1247082419-Apr-16 5:03
Member 1247082419-Apr-16 5:03 
Questioncall dll on client side Pin
Member 435374515-Jul-09 21:15
Member 435374515-Jul-09 21:15 
QuestionOwn Report Printer - How to print out Source Code (syntax highlighting) Pin
akamper15-Jul-09 21:09
akamper15-Jul-09 21:09 
Questionuse dataset with case statement Pin
Mamphekgo Bahula15-Jul-09 20:54
Mamphekgo Bahula15-Jul-09 20:54 
AnswerRe: use dataset with case statement Pin
Mycroft Holmes15-Jul-09 21:02
professionalMycroft Holmes15-Jul-09 21:02 
QuestionHow to use public int?!!?!!? windows form. Pin
dimo198215-Jul-09 20:39
dimo198215-Jul-09 20:39 
AnswerRe: How to use public int?!!?!!? windows form. Pin
ichiganboya15-Jul-09 20:44
ichiganboya15-Jul-09 20:44 
GeneralRe: How to use public int?!!?!!? windows form. Pin
dimo198216-Jul-09 6:42
dimo198216-Jul-09 6:42 
Hello still nothing cannot solve this problem, so what i tried is i tried declare variable as a (public int nameOfInteger) just before the method, in the begining oif the class and everywhere else. Still confused

thats my code

namespace ExerciseInt
{
    public partial class Form1 : Form
    {
      int newNumber;
        
        public Form1()
        {
            InitializeComponent();
           
        }

        public void button1_Click(object sender, EventArgs e)
        {
            Random myRandom = new Random
            myNumber = myRandom.Next(1,10);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            MessageBox.Show(myNumber.ToString());
        }
    }
}


so when i click button1 variable should be set up and when click button2 i would like to see this variable in the message box.

looking forward to hear from you.
GeneralRe: How to use public int?!!?!!? windows form. Pin
Huxley Stronghead16-Jul-09 10:07
Huxley Stronghead16-Jul-09 10:07 
AnswerRe: How to use public int?!!?!!? windows form. Pin
Mycroft Holmes15-Jul-09 21:06
professionalMycroft Holmes15-Jul-09 21:06 
AnswerRe: How to use public int?!!?!!? windows form. Pin
Luc Pattyn15-Jul-09 23:58
sitebuilderLuc Pattyn15-Jul-09 23:58 
Questionhow can i develop a program in aspx format and use it in php site?!! Pin
Nafiseh Salmani15-Jul-09 20:16
Nafiseh Salmani15-Jul-09 20:16 
AnswerRe: How could I generate a custom search with C# Pin
Mycroft Holmes15-Jul-09 21:07
professionalMycroft Holmes15-Jul-09 21:07 
GeneralRe: How could I generate a custom search with C# Pin
Nafiseh Salmani15-Jul-09 21:13
Nafiseh Salmani15-Jul-09 21:13 
QuestionC# 3D Button UserControl (How to increase performance) Pin
ichiganboya15-Jul-09 20:10
ichiganboya15-Jul-09 20:10 
AnswerRe: C# 3D Button UserControl (How to increase performance) Pin
ichiganboya15-Jul-09 23:17
ichiganboya15-Jul-09 23:17 
QuestionUsing F2 F3 In Web application Pin
kKamel15-Jul-09 20:04
kKamel15-Jul-09 20:04 
QuestionHow to add a button in the standard buttons list of IE window? Pin
svt gdwl15-Jul-09 19:09
svt gdwl15-Jul-09 19:09 
QuestionNeed help. Pin
mjawadkhatri15-Jul-09 19:07
mjawadkhatri15-Jul-09 19:07 
AnswerRe: Need help. Pin
Abhijit Jana15-Jul-09 19:31
professionalAbhijit Jana15-Jul-09 19:31 
GeneralRe: Need help. Pin
mjawadkhatri15-Jul-09 19:37
mjawadkhatri15-Jul-09 19:37 
GeneralRe: Need help. Pin
K030615-Jul-09 19:44
K030615-Jul-09 19:44 
GeneralRe: Need help. Pin
mjawadkhatri15-Jul-09 19:46
mjawadkhatri15-Jul-09 19:46 
GeneralRe: Need help. Pin
K030615-Jul-09 20:20
K030615-Jul-09 20:20 
GeneralRe: Need help. Pin
mjawadkhatri15-Jul-09 20:24
mjawadkhatri15-Jul-09 20:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.