3 Replies - 7328 Views - Last Post: 08 August 2009 - 11:05 PM Rate Topic: -----

#1 xxCODERxx  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 31-July 09

Font Dialog and Color Dialog

Posted 31 July 2009 - 11:38 PM

Hi. How can I put the font selection and color selection in just one window.?
I saw here [http://www.java2s.com/Code/CSharp/GUI-Windows-Form/ColorDialogandFontDialog.htm]
that it is possible, but I am having a hard time understanding the code.

can someone please give an idea about a simpler code for this one.?
thanks.
Is This A Good Question/Topic? 0
  • +

Replies To: Font Dialog and Color Dialog

#2 janne_panne  Icon User is offline

  • WinRT Dev
  • member icon

Reputation: 429
  • View blog
  • Posts: 1,047
  • Joined: 09-June 09

Re: Font Dialog and Color Dialog

Posted 01 August 2009 - 12:17 AM

Try this on your fontdialog:

			FontDialog fd = new FontDialog();
			fd.ShowColor = true;


Was This Post Helpful? 0
  • +
  • -

#3 xxCODERxx  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 31-July 09

Re: Font Dialog and Color Dialog

Posted 01 August 2009 - 01:25 AM

^^ wow. it works.!
my selection works now. :)

thanks alot.!! :D
Was This Post Helpful? 0
  • +
  • -

#4 xxCODERxx  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 31-July 09

Re: Font Dialog and Color Dialog

Posted 08 August 2009 - 11:05 PM

private void fd_Click(object sender, EventArgs e)
		{
			FontDialog fd = new FontDialog();

			fd.ShowColor = true;

			if (fd.ShowDialog() == DialogResult.OK)
			{
				write.SelectionFont = fd.Font;
				write.SelectionColor = fd.Color;

			}
		}

		private void write_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Enter)
			{
				method();
				write.Text = string.Empty;
			}
		}


I encountered another problem for my chat system. When I pick or change the font style and color, then entered or send the message it will set back to the default font letting or making the user pick the font and color again.
What code should I add in my program? THANKS. :D



-- NEVERMIND. i got it. :D

This post has been edited by xxCODERxx: 08 August 2009 - 11:58 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1