41
Coding / Re: Real Time Zelda Textbox (Updated 10 Oct. 2006)
« on: November 20, 2006, 05:54:07 am »
hey guys just to let u know the link is www.binaryphoenix.com/scooternew/Realtime_Textbox.gm6
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Font_Chooser
{
public partial class myForm : Form
{
public myForm()
{
InitializeComponent();
}
public class Form : System.Windows.Forms.Form
{
//My own variables
private System.Drawing.Font myFont;
private string fontName = "Arial";
private int fontSize = 20;
private FontStyle myStyle = FontStyle.Regular;
}
private void AssignFont(){
//uses the variables to assign a font
//check the listbox for a font name
fontName = lstFontName.Text;
//look at check boxes for styles
myStyle = FontStyle.Regular;
if (chkBold.Checked){
myStyle = myStyle | FontStyle.Bold;
} //End If
if (chkItalic.Checked){
myStyle = mySytle | FontStyle.Italic;
} //End If
//Create the new font and attach to the label
myFont = new Font(fontName, fontSize, myStyle);
lblSample.Font = myFont;
}//End Assignment
private void lstFontName_SelectedIndexChanged(object sender, System.EventArgs e){
AssignFont();
}
private void chkBold_CheckedChanged(object sender, System.EventArgs e){
AssignFont();
}
private void chkItalic_CheckedChanged(object sender, System.EventArgs e){
AssignFont();
}
private void rad1_CheckedChanged(object sender, System.EventArgs e){
fontSize = 10;
AssignFont();
}
private void rad2_CheckedChanged(object sender, System.EventArgs e){
fontSize = 20;
AssignFont();
}//End AssignFont
}
}