Click here to Skip to main content
15,891,597 members
Home / Discussions / C#
   

C#

 
GeneralRe: DateTime.Now.ToLongDateString() Pin
OriginalGriff28-Jul-10 1:53
mveOriginalGriff28-Jul-10 1:53 
GeneralRe: DateTime.Now.ToLongDateString() Pin
Member 387988128-Jul-10 1:58
Member 387988128-Jul-10 1:58 
GeneralRe: DateTime.Now.ToLongDateString() Pin
Dave Kreskowiak28-Jul-10 3:30
mveDave Kreskowiak28-Jul-10 3:30 
GeneralRe: DateTime.Now.ToLongDateString() Pin
Dave Kreskowiak28-Jul-10 3:29
mveDave Kreskowiak28-Jul-10 3:29 
AnswerRe: DateTime.Now.ToLongDateString() Pin
Luc Pattyn28-Jul-10 2:36
sitebuilderLuc Pattyn28-Jul-10 2:36 
Questionincrease the font size of the text and size of the controls, when click on maximize button Pin
NarVish28-Jul-10 0:12
NarVish28-Jul-10 0:12 
AnswerRe: increase the font size of the text and size of the controls, when click on maximize button Pin
Łukasz Nowakowski28-Jul-10 0:35
Łukasz Nowakowski28-Jul-10 0:35 
AnswerRe: increase the font size of the text and size of the controls, when click on maximize button Pin
Nuri Ismail28-Jul-10 0:41
Nuri Ismail28-Jul-10 0:41 
If you change the font size of your form, your controls (on the form) will follow this change and will resize automatically. So the only thing you need is to change the font size of your form.
Here is an example for you:
C#
public partial class Form1 : Form
{
    float defaultFontSize;
    float bigFontSize;

    public Form1()
    {
        InitializeComponent();

        // Init font sizes
        defaultFontSize = this.Font.Size;
        bigFontSize = 16;
    }

    // Check for Maximize and Restore on Resize event.
    // Set the big font size if the form is maximized.
    // Reset the default font size (only in need) if the form is not maximized.
    private void Form1_Resize(object sender, EventArgs e)
    {
        // Check the window state of the form
        if (this.WindowState == FormWindowState.Maximized)
        {
            // Update only in need
            if (this.Font.Size < bigFontSize)
            {
                // Set the big font size
                FontFamily ff = this.Font.FontFamily;
                this.Font.Dispose();

                this.Font = new System.Drawing.Font(ff, bigFontSize);
                Invalidate();
            }
        }
        else if (this.WindowState == FormWindowState.Normal)
        {
            // Update only in need
            if (this.Font.Size > defaultFontSize)
            {
                // Reset the default font size
                FontFamily ff = this.Font.FontFamily;
                this.Font.Dispose();

                this.Font = new System.Drawing.Font(ff, defaultFontSize);
                Invalidate();
            }
        }
    }
}


Put some controls on your form and see what happens. Smile | :)
GeneralRe: increase the font size of the text and size of the controls, when click on maximize button Pin
NarVish28-Jul-10 2:23
NarVish28-Jul-10 2:23 
GeneralRe: increase the font size of the text and size of the controls, when click on maximize button Pin
Nuri Ismail28-Jul-10 3:10
Nuri Ismail28-Jul-10 3:10 
QuestionGenerate Text File Pin
tek 200927-Jul-10 22:41
tek 200927-Jul-10 22:41 
AnswerRe: Generate Text File Pin
OriginalGriff27-Jul-10 22:52
mveOriginalGriff27-Jul-10 22:52 
GeneralRe: Generate Text File Pin
tek 200927-Jul-10 23:16
tek 200927-Jul-10 23:16 
GeneralRe: Generate Text File Pin
Pete O'Hanlon27-Jul-10 23:22
mvePete O'Hanlon27-Jul-10 23:22 
AnswerRe: Generate Text File Pin
tek 200927-Jul-10 23:36
tek 200927-Jul-10 23:36 
GeneralRe: Generate Text File Pin
OriginalGriff27-Jul-10 23:28
mveOriginalGriff27-Jul-10 23:28 
AnswerRe: Generate Text File Pin
tek 200928-Jul-10 0:15
tek 200928-Jul-10 0:15 
GeneralRe: Generate Text File Pin
OriginalGriff28-Jul-10 0:20
mveOriginalGriff28-Jul-10 0:20 
AnswerRe: Generate Text File Pin
Peace ON27-Jul-10 22:53
Peace ON27-Jul-10 22:53 
QuestionWhy cant I access my forms design Pin
TSWatson27-Jul-10 22:27
TSWatson27-Jul-10 22:27 
AnswerRe: Why cant I access my forms design Pin
Khaniya28-Jul-10 0:30
professionalKhaniya28-Jul-10 0:30 
Questionhow to convert google guage chart in pdf format.. Pin
Nagendra Pal27-Jul-10 21:34
Nagendra Pal27-Jul-10 21:34 
AnswerRe: how to convert google guage chart in pdf format.. Pin
Nagy Vilmos27-Jul-10 22:17
professionalNagy Vilmos27-Jul-10 22:17 
GeneralRe: how to convert google guage chart in pdf format.. Pin
OriginalGriff27-Jul-10 22:55
mveOriginalGriff27-Jul-10 22:55 
QuestionProblem with pc to pc Voice chat on LAN using h323 protocol. Pin
88Rocker27-Jul-10 18:46
88Rocker27-Jul-10 18:46 

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.