When FontDialog is closed, you have to check if the user clicked ok or cancel. if he clicked ok, the information about the font he chose returns. You can save the information in variables, or do whatever you want with it. goodluck.
Code:
FontDialog fontDialog = new FontDialog();
DialogResult dr = fontDialog.ShowDialog();
if (dr == DialogResult.OK)
{
//The data about the font returns.
//You can use this data.
/*
* fontDialog.Color is the color the user chose
* fontDialog.Font is the font the user chose
* fontDialog.Font.Style returns the font style the user chose
* fontDialog.Font.SystemFontName is the fontName the user chose
* fontDialog.Font.Size returns the font size the user chose
* fontDialog.Font.Underline returns true if the the user's font is bold
* fontDialog.Font.Underline returns true if the the user's font has an underline
* fontDialog.Font.Strikeout returns true if the the user's font is strikeout
* fontDialog.Font.Italic returns true if the the user's font is italic
* And so on...
*/
}
Note that you need to use the System.Windows.Forms namespace.
It was very helpfull , i can now save the information in a xml file but when i try to read them back it gaves an error like "can't convert to FontDialog etc."
This is the code
Code:
if (cfgReader.LocalName.Equals("Font"))
{
temp = cfgReader.ReadString();
if (temp != null)
this.txtMemo.Font = (FontDialog)temp;
}
Why are you trying to convert a string to a FontDialog? You should create the font dialog object and set the font name property (and other properties).
Also, you really should consider using Properties.Settings to save your application settings - that's what it's there for.
Ok I do with application settings that is implemented standard in visual.net
i have placed a picture of the settings to see it for you, but the question now is how can i manipulate that settings from a form ?
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.