I need to make it so the brush covers a certain number of squares in a pre designed pattern like the following:

[url]http://www.kulturservern.se/wronsov/selfpassage/XXI/XXI-0804/GoF1.gif[/url]

Is there a way to make the brush shaped like that?

Iv made conways game of life, but I want the user to be able to select a pre defined pattern or for them to be able to choose different shaped brushes then draw with that brush.

Aswell, when I use the radio buttons to change the size, the program goes slow and stops working, does anyone know why that is?

And, Iv tried to create an eraser type tool using brush color.empty, but it doesnt work, how can I create an eraser tool, or a button to completely clear what the user has drawn, everything Iv tried has not worked.

One more thing, when I change the size the squares drawn do not align to the grid properly, can anyone see why?

Any help with any of these things would be great.

Cheers

[CODE]using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GameOfLife
{
public partial class Form1 : Form
{
cField Field = new cField();
bool MouseIsDown = false;
Brush mybrush = new SolidBrush(Color.White);
private int squaresize = 4;
private int gridSizex = 602;
private int gridSizey = 500;
private int Lines = 1;
private int squareheight = 4;
private int squarewidth = 4;

    public Form1()
    {
        InitializeComponent();
        timer1.Interval = trackBar1.Value;

    }
    private void pictureBox1_Paint(object sender, PaintEventArgs e)
    {
        if (this.radioSmall.Checked)
        {
            squaresize = 4;
            squareheight = 4;
            squarewidth = 4;
            this.pictureBox1.Refresh();
        }
        if (this.radioMedium.Checked)
        {
            squaresize = 8;
            squareheight = 8;
            squarewidth = 8;
            this.pictureBox1.Refresh();
        }
        if (this.radioLarge.Checked)
        {
            squaresize ...

Hi, I am using 2 list boxes with 4 values in each. I want to create an action when a button is pressed on the form which will be something like this:

If(value of list box1 is 1 and value of list box2 is 1)
{
total = total + 1;
}
elseif(value of listbox1 is 1 and value of listbox2 is 2)
{
total = total + 2;
}... and so on

anyway thats what I want to happen, but Iv tried a few things, and none have worked. All I want to do is check the value of my list boxes then increase a variable by a certain amount. I have declared my total variable but I cant get it to work, if anyone has a solution it would be great.

Cheers

Sorry, I forgot to mention some other things, Iv tried calling the start() and init() methods using a button. If there is anything else you can spot I would be very grateful.

Hi, Iv had to convert a program from Java to C#, I thought I had done it, but it doesnt work, and Im at a loose end because I cant figure out why it isnt working. Anyway, what it is is a Mandelbrot Set that Im trying to display in a picturebox, I am drawing the fractal to a bitmap then getting the picturebox to display the bitmap. If anyone can explain what Im doing wrong that would be great.

[CODE]using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.Design;

namespace Assignment_Attempt_3
{
public partial class Form1 : Form
{

    public Form1()
    {
        InitializeComponent();
        Image bp = new Bitmap(this.pictureBox1.Height,this.pictureBox1.Width);
        Graphics g1 = Graphics.FromImage(bp);
        pictureBox1.Image = bp;

    }
        public struct HSBColor
{
    float h;
    float s;
    float b;
    int a;

    public HSBColor(float h, float s, float b)
    {
        this.a = 0xff;
        this.h = Math.Min(Math.Max(h, 0), 255);
        this.s = Math.Min(Math.Max(s, 0), 255);
        this.b = Math.Min(Math.Max(b, 0), 255);
    }

    public HSBColor(int a, float h, float s, float b)
    {
        this.a = a;
        this.h = Math.Min(Math.Max(h, 0), 255);
        this.s = Math.Min(Math.Max(s, 0), 255);
        this.b = Math.Min(Math.Max(b, 0), 255);
    }

    public float H
    {
        get { return h; }
    }

    public float S
    {
        get { return s; }
    }

    public float B
    {
        get { return b; }
    }

    public int A
    {
        get { return a; }
    }

    public Color Color
    {
        get
        {
            return FromHSB(this);
        }
    }

    public static Color FromHSB(HSBColor hsbColor) ...