Click here to Skip to main content
15,913,773 members
Home / Discussions / C#
   

C#

 
Questionputting image on other image in ms word Pin
praveen pandey15-Jan-07 16:48
praveen pandey15-Jan-07 16:48 
AnswerRe: putting image on other image in ms word Pin
Christian Graus15-Jan-07 16:59
protectorChristian Graus15-Jan-07 16:59 
GeneralRe: putting image on other image in ms word Pin
praveen pandey15-Jan-07 17:18
praveen pandey15-Jan-07 17:18 
GeneralRe: putting image on other image in ms word Pin
Christian Graus15-Jan-07 17:26
protectorChristian Graus15-Jan-07 17:26 
GeneralRe: putting image on other image in ms word Pin
praveen pandey15-Jan-07 17:38
praveen pandey15-Jan-07 17:38 
GeneralRe: putting image on other image in ms word Pin
Christian Graus15-Jan-07 17:50
protectorChristian Graus15-Jan-07 17:50 
AnswerRe: putting image on other image in ms word Pin
davidc2p16-Jan-07 6:18
davidc2p16-Jan-07 6:18 
QuestionWhat In The World Is Going On!!?? Pin
BlitzPackage15-Jan-07 15:23
BlitzPackage15-Jan-07 15:23 
Good People,

Why is the following code not compiling:

<br />
Random myRandom = new Random();<br />
int iNumber = 0;<br />
iNumber = myRandom.Next(1, 8);<br />


It keeps telling me that:

Error 1: Invalid token '=' in class, struct, or interface member declaration

and in reference to the function "Next(...)" of class Random, it tells me:

Error 2: Invalid token '(' in class, struct, or interface member declaration

Furthermore, when I try to use myRandom auto-complete does not see it. I am truly puzzled since I have the following usings:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

I am truly puzzled about what's going on. Any help you can provide would be greatly appreicated. Below is the entire partial class for reference:

namespace Chris<br />
{<br />
    public partial class Chris : Form<br />
    {<br />
        public Chris()<br />
        {<br />
            InitializeComponent();<br />
        }<br />
<br />
        Random myRandom = new Random();<br />
        int iNumber = 0;<br />
<br />
        iNumber = myRandom.Next(1, 8);<br />
<br />
        bool shouldDraw = false;<br />
<br />
        private void OnMouseDown(object sender, MouseEventArgs e)<br />
        {<br />
            shouldDraw = true;<br />
        }<br />
<br />
        private void OnMouseUp(object sender, MouseEventArgs e)<br />
        {<br />
            shouldDraw = false;<br />
        }<br />
<br />
        private void OnMouseMove(object sender, MouseEventArgs e)<br />
        {<br />
            if (shouldDraw)<br />
            {<br />
                Graphics myGraphics = CreateGraphics();<br />
<br />
                myGraphics.FillRectangle(new SolidBrush(Color.FromArgb(250, 155, 59)), e.X, e.Y, 5, 5);<br />
<br />
                myGraphics.Dispose();<br />
            }<br />
        }<br />
    }<br />
}

AnswerRe: What In The World Is Going On!!?? Pin
Christian Graus15-Jan-07 15:33
protectorChristian Graus15-Jan-07 15:33 
GeneralRe: What In The World Is Going On!!?? Pin
BlitzPackage15-Jan-07 15:44
BlitzPackage15-Jan-07 15:44 
QuestionDesign-Time Collection Serialization Pin
Tyrus18215-Jan-07 15:04
Tyrus18215-Jan-07 15:04 
GeneralRe: Design-Time Collection Serialization Pin
Phillip M. Hoff15-Jan-07 16:33
Phillip M. Hoff15-Jan-07 16:33 
QuestionPrevent reflection access to private fields? Pin
wout de zeeuw15-Jan-07 13:19
wout de zeeuw15-Jan-07 13:19 
AnswerRe: Prevent reflection access to private fields? Pin
Colin Angus Mackay15-Jan-07 13:50
Colin Angus Mackay15-Jan-07 13:50 
GeneralRe: Prevent reflection access to private fields? Pin
wout de zeeuw15-Jan-07 21:44
wout de zeeuw15-Jan-07 21:44 
QuestionHelp! Datagridview Pin
bluewavestrider15-Jan-07 12:56
bluewavestrider15-Jan-07 12:56 
AnswerRe: Help! Datagridview Pin
L Viljoen15-Jan-07 20:43
professionalL Viljoen15-Jan-07 20:43 
AnswerRe: Help! Datagridview Pin
Lisa Jorgensen17-Jan-07 14:42
Lisa Jorgensen17-Jan-07 14:42 
QuestionLabel change on MasterPages Pin
bonokoot15-Jan-07 10:39
bonokoot15-Jan-07 10:39 
AnswerRe: Label change on MasterPages Pin
Not Active15-Jan-07 10:53
mentorNot Active15-Jan-07 10:53 
GeneralRe: Label change on MasterPages Pin
bonokoot15-Jan-07 11:22
bonokoot15-Jan-07 11:22 
GeneralRe: Label change on MasterPages Pin
Not Active15-Jan-07 11:43
mentorNot Active15-Jan-07 11:43 
Questionwhere does install WebApplicationProjectSetup ? Pin
hdv21215-Jan-07 9:35
hdv21215-Jan-07 9:35 
QuestionHow to run your application by double-clicking a file? Pin
Lyfkcd15-Jan-07 9:03
Lyfkcd15-Jan-07 9:03 
AnswerRe: How to run your application by double-clicking a file? Pin
Not Active15-Jan-07 10:06
mentorNot Active15-Jan-07 10:06 

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.