@@ -43,7 +43,7 @@ public FormMain()
4343 readonly Dictionary < string , string > _languageDicoEn = new Dictionary < string , string > ( ) ;
4444 readonly Dictionary < string , string > _languageDicoFr = new Dictionary < string , string > ( ) ;
4545 private string _currentLanguage = "english" ;
46- private float _fontSize = 10 ;
46+ private float _fontSize ;
4747
4848 private void QuitToolStripMenuItem_Click ( object sender , EventArgs e )
4949 {
@@ -77,6 +77,7 @@ private void LoadSettingsAtStartup()
7777 GetWindowValue ( ) ;
7878 LoadLanguages ( ) ;
7979 SetLanguage ( Settings . Default . LastLanguageUsed ) ;
80+ AdjustAllControls ( ) ;
8081 }
8182
8283 private static void LoadComboBox ( ComboBox cb , string fileName )
@@ -337,6 +338,7 @@ private void GetWindowValue()
337338 Left = Settings . Default . WindowLeft < 0 ? 0 : Settings . Default . WindowLeft ;
338339 SetDisplayOption ( Settings . Default . DisplayToolStripMenuItem ) ;
339340 comboBoxLanguage . SelectedIndex = Settings . Default . comboBoxLanguage ;
341+ _fontSize = Settings . Default . _fontSize ;
340342 }
341343
342344 private void SaveWindowValue ( )
@@ -348,6 +350,7 @@ private void SaveWindowValue()
348350 Settings . Default . LastLanguageUsed = frenchToolStripMenuItem . Checked ? "French" : "English" ;
349351 Settings . Default . DisplayToolStripMenuItem = GetDisplayOption ( ) ;
350352 Settings . Default . comboBoxLanguage = comboBoxLanguage . SelectedIndex ;
353+ Settings . Default . _fontSize = _fontSize ;
351354 Settings . Default . Save ( ) ;
352355 }
353356
@@ -672,15 +675,15 @@ private void MediumToolStripMenuItem_Click(object sender, EventArgs e)
672675 {
673676 UncheckAllOptions ( ) ;
674677 MediumToolStripMenuItem . Checked = true ;
675- _fontSize = 12f ;
678+ _fontSize = 11f ;
676679 AdjustAllControls ( ) ;
677680 }
678681
679682 private void LargeToolStripMenuItem_Click ( object sender , EventArgs e )
680683 {
681684 UncheckAllOptions ( ) ;
682685 LargeToolStripMenuItem . Checked = true ;
683- _fontSize = 14f ;
686+ _fontSize = 12f ;
684687 AdjustAllControls ( ) ;
685688 }
686689
@@ -697,12 +700,13 @@ private void AdjustControls(params Control[] listOfControls)
697700 {
698701 if ( isFirstControl )
699702 {
703+ control . Font = new Font ( new FontFamily ( "Verdana" ) , _fontSize ) ;
700704 isFirstControl = false ;
701705 }
702706 else
703707 {
704- control . Left = position + 10 ;
705- position += control . Width ;
708+ control . Left = position + 25 ;
709+ position += control . Width + 10 ;
706710 control . Font = new Font ( new FontFamily ( "Verdana" ) , _fontSize ) ;
707711 }
708712 }
@@ -717,12 +721,12 @@ private float GetFontSize()
717721
718722 if ( MediumToolStripMenuItem . Checked )
719723 {
720- return 12 ;
724+ return 11 ;
721725 }
722726
723727 if ( LargeToolStripMenuItem . Checked )
724728 {
725- return 14 ;
729+ return 12 ;
726730 }
727731
728732 return 10 ;
@@ -732,6 +736,12 @@ private void AdjustAllControls()
732736 {
733737 AdjustControls ( labelChooseLanguage , comboBoxLanguage , buttonCountWords , buttonClear ) ;
734738 AdjustControls ( labelWordsCount , labelCharacterCount ) ;
739+ AdjustControlsTextBased ( textBoxSource ) ;
740+ }
741+
742+ private void AdjustControlsTextBased ( Control textBox )
743+ {
744+ textBox . Font = new Font ( new FontFamily ( "Verdana" ) , _fontSize ) ;
735745 }
736746
737747 private void buttonCountWords_Click ( object sender , EventArgs e )
0 commit comments