I'm trying to develop a method that resizes the font of a label on the form by 0.25f each time the size changes by 1. I'm thinking create a ratio or do some math about the font size based on the form size like i do with other controls.

I am not sure if you can resize the size of a label at run-time, so instead I made it change the text of a label (making it a bigger or smaller number):

int height;
        int width;

        private void Form1_Load(object sender, EventArgs e)
        {
            height = 362;
            width = 634;
        }

        private void Form1_Resize(object sender, EventArgs e)
        {            
            if (this.Size.Height > height || this.Size.Width > width)
            {
                height = this.Size.Height;
                width = this.Size.Width;
                label1.Text = (Int32.Parse(label1.Text) + 1).ToString();
            }
            else if (this.Size.Height < height || this.Size.Width < width)
            {
                height = this.Size.Height;
                width = this.Size.Width;
                label1.Text = (Int32.Parse(label1.Text) - 1).ToString();
            }
        }

Hope this helps!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.