views:

17

answers:

2

Hi All,

I want to display font dialog box in my web application(asp.net). Im using the following code. Its working fine.

Problem: Dialogbox is getting open but it is behind the page. Even though i closed the application it is still open. It is not binded to the application.

Code:

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

        DialogResult dR = fontDialog.ShowDialog();

        if (dR == DialogResult.OK)
        {
            txtChange.Font = fntDialog.Font;
        }

Edit:

I want to create an application for Entry pages to fill the database. In this i want to store text and its font size, name and color.

Im my mind there are two options:

  1. Displaying the fonts from the system.(Dropped bcz these entry page application is in the one system and the report page application going to run kiosk). It will create problem if the fonts are not available in the kiosk.

    1. Font dialogbox.(Also creating problem)

Please is there any other good option for this.

+1  A: 

Er.... this is NOT a good idea. This dialog will launch on the server, which means if you are accessing this from a remote computer (which is more than likely), you'll never see the dialog, but the server could end up with countless dialog instances popping up.

What use is the fonts dialog in a web application anyway??

EDIT: To be safe, I'd produce a list of known fonts on the system and then simply list them in a drop down box. You've already discovered the problem with enumerating the fonts and attempting to use a dialog.

Matthew Abbott
@Geetha: Try accessing your dev site from another machine and watch what happens...
ck
Thanks for your response. Please see the Edit portion of my query.
Geetha
Updated response.
Matthew Abbott
A: 

There are lots of Html font coloring panel free over web , written in javascript. For setting values of Font Sizes you can use a dropdown for the same with your predefined values. While saving , save the value of font size and its concerned data as plain text in db and while fetching apply it.

Amit Ranjan