Click here to Skip to main content
15,879,095 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# interop with COM Pin
Nish Nishant20-Oct-02 15:28
sitebuilderNish Nishant20-Oct-02 15:28 
GeneralRe: C# interop with COM Pin
Stephane Rodriguez.20-Oct-02 23:29
Stephane Rodriguez.20-Oct-02 23:29 
GeneralInterop question...C# DllImport with const Pin
Jon Rista20-Oct-02 13:37
Jon Rista20-Oct-02 13:37 
GeneralRe: Interop question...C# DllImport with const Pin
leppie20-Oct-02 13:52
leppie20-Oct-02 13:52 
GeneralRe: Interop question...C# DllImport with const Pin
Jon Rista20-Oct-02 14:21
Jon Rista20-Oct-02 14:21 
GeneralRe: Interop question...C# DllImport with const Pin
Jon Rista23-Oct-02 17:55
Jon Rista23-Oct-02 17:55 
GeneralRe: Interop question...C# DllImport with const Pin
leppie24-Oct-02 12:31
leppie24-Oct-02 12:31 
GeneralFont Program Pin
Substitute20-Oct-02 3:01
Substitute20-Oct-02 3:01 
This program should show all the installed fonts in their typeface but it doesn't show anything instead whats wrong?

using System;
using System.Drawing;
using System.Drawing.Text;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace FontViewer
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.ListView listView1;
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
private System.Windows.Forms.MenuItem menuItem3;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}

///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
System.Configuration.AppSettingsReader configurationAppSettings = new System.Configuration.AppSettingsReader();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.listView1 = new System.Windows.Forms.ListView();
this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
this.menuItem3 = new System.Windows.Forms.MenuItem();
this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
//
this.tabControl1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.tabPage1});
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(624, 353);
this.tabControl1.TabIndex = 2;
//
// tabPage1
//
this.tabPage1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.listView1});
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(616, 327);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Installed Fonts";
//
// listView1
//
this.listView1.CausesValidation = false;
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader2});
this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.listView1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.listView1.MultiSelect = false;
this.listView1.Name = "listView1";
this.listView1.Scrollable = ((bool)(configurationAppSettings.GetValue("listView1.Scrollable", typeof(bool))));
this.listView1.Size = new System.Drawing.Size(616, 327);
this.listView1.Sorting = System.Windows.Forms.SortOrder.Ascending;
this.listView1.TabIndex = 1;
this.listView1.View = System.Windows.Forms.View.Details;
//
// columnHeader2
//
this.columnHeader2.Text = "Names";
this.columnHeader2.Width = 595;
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem1,
this.menuItem3});
//
// menuItem1
//
this.menuItem1.Index = 0;
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem2});
this.menuItem1.Text = "File";
//
// menuItem2
//
this.menuItem2.Index = 0;
this.menuItem2.Shortcut = System.Windows.Forms.Shortcut.CtrlQ;
this.menuItem2.Text = "Exit";
this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
//
// menuItem3
//
this.menuItem3.Index = 1;
this.menuItem3.Text = "About";
this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click);
//
// columnHeader1
//
this.columnHeader1.Width = 612;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(624, 353);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.tabControl1});
this.Menu = this.mainMenu1;
this.Name = "Form1";
this.Text = "Leons Font Program";
this.Load += new System.EventHandler(this.Form1_Load);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.ResumeLayout(false);

}
#endregion

///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());

}

private void Form1_Load(object sender, System.EventArgs e)
{
Graphics grfx = CreateGraphics();
Color c = Color.Black;
Brush brush = new SolidBrush(c);
float y = 0;
FontFamily[] aff = FontFamily.Families;


foreach (FontFamily ff in aff)
{
if(ff.IsStyleAvailable(FontStyle.Regular))
{
Font font = new Font(ff, 12);
grfx.DrawString(ff.Name, font, brush, 0, y);
y += font.GetHeight(grfx);
}
}

}

private void menuItem3_Click(object sender, System.EventArgs e)
{
MessageBox.Show("Made By Leon Radley, 2002");
}

private void menuItem2_Click(object sender, System.EventArgs e)
{
Application.Exit();
}
}
}

Cheers
GeneralRe: Font Program Pin
Wjousts20-Oct-02 12:24
Wjousts20-Oct-02 12:24 
QuestionHow can I access Classes from NON-COM DLL's Pin
Rodney S. Foley19-Oct-02 16:27
Rodney S. Foley19-Oct-02 16:27 
AnswerRe: How can I access Classes from NON-COM DLL's Pin
Nish Nishant19-Oct-02 17:12
sitebuilderNish Nishant19-Oct-02 17:12 
GeneralRe: How can I access Classes from NON-COM DLL's Pin
Rodney S. Foley19-Oct-02 17:28
Rodney S. Foley19-Oct-02 17:28 
GeneralRe: How can I access Classes from NON-COM DLL's Pin
Nish Nishant19-Oct-02 18:31
sitebuilderNish Nishant19-Oct-02 18:31 
GeneralRe: How can I access Classes from NON-COM DLL's Pin
James T. Johnson19-Oct-02 23:37
James T. Johnson19-Oct-02 23:37 
Generalregular expressions Pin
Jeremy Pullicino19-Oct-02 12:26
Jeremy Pullicino19-Oct-02 12:26 
GeneralRe: regular expressions Pin
Paul Riley19-Oct-02 13:06
Paul Riley19-Oct-02 13:06 
GeneralRe: regular expressions Pin
James T. Johnson19-Oct-02 13:14
James T. Johnson19-Oct-02 13:14 
GeneralRe: regular expressions Pin
James T. Johnson19-Oct-02 13:17
James T. Johnson19-Oct-02 13:17 
GeneralRe: regular expressions Pin
Paul Riley19-Oct-02 13:35
Paul Riley19-Oct-02 13:35 
GeneralRe: regular expressions Pin
Jeremy Pullicino19-Oct-02 13:41
Jeremy Pullicino19-Oct-02 13:41 
GeneralRe: regular expressions Pin
James T. Johnson19-Oct-02 13:55
James T. Johnson19-Oct-02 13:55 
GeneralRe: regular expressions Pin
Paul Riley20-Oct-02 1:36
Paul Riley20-Oct-02 1:36 
GeneralRe: regular expressions Pin
Eric Gunnerson (msft)22-Oct-02 11:43
Eric Gunnerson (msft)22-Oct-02 11:43 
QuestionEquivalent Win32 API to Control.InvokePaint? Pin
Li-kai Liu (Angus)19-Oct-02 11:37
Li-kai Liu (Angus)19-Oct-02 11:37 
AnswerRe: Equivalent Win32 API to Control.InvokePaint? Pin
David Stone19-Oct-02 12:12
sitebuilderDavid Stone19-Oct-02 12:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.