Changing text font in design time

Just starting to learn vb. My instructor wants textbox font properties to change with a click event while the app. is running. This is probably simple to code, but I could really use some help.thanks, mk

Comments

Here's what you can do. It's a generic approach, but I tried it for VB2005:Assuming you have the form with the etextbox ready, add a FontDialog control (double click it in the toolbox. Change the name however you want. Then add a button to trigger the font dialog, and double click the button to have the IDE generate a method stub that responds to the default event of the button (single click). Then write somethings as follows:'********************FontDialog1.Font = TextBox1.Font ' Will show the current font settings of the text box in the dialogFontDialog1.ShowDialog()TextBox1.Font = FontDialog1.Font' Done!'********************

It's the same in all VB, just a bit different controls.

: Just starting to learn vb. My instructor wants textbox font properties to change with a click event while the app. is running. This is probably simple to code, but I could really use some help.: thanks,: mk:

: Here's what you can do. It's a generic approach, but I tried it for VB2005:: Assuming you have the form with the etextbox ready, add a FontDialog control (double click it in the toolbox. Change the name however you want. Then add a button to trigger the font dialog, and double click the button to have the IDE generate a method stub that responds to the default event of the button (single click). Then write somethings as follows:: '********************: FontDialog1.Font = TextBox1.Font ' Will show the current font settings of the text box in the dialog: FontDialog1.ShowDialog(): TextBox1.Font = FontDialog1.Font: ' Done!: '********************: : It's the same in all VB, just a bit different controls.: : : Just starting to learn vb. My instructor wants textbox font properties to change with a click event while the app. is running. This is probably simple to code, but I could really use some help.: : thanks,: : mk: : : :