home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2005 March
/
CMCD0305.ISO
/
Software
/
Shareware
/
Programare
/
meesageview
/
MVSetup.msi
/
_D37BEEA2FA7FCB676F731C0EE8A89AE4
/
_49AC81B2F6EB4F198A00AC02D7A8F8FB
< prev
next >
Wrap
Text File
|
2004-12-22
|
5KB
|
130 lines
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace dcwsolutions.MessageView.Sample1
{
public class Form1 : System.Windows.Forms.Form
{
private dcwsolutions.MessageView.MessageView messageView1;
private dcwsolutions.MessageView.MessageViewPanel messageViewPanel1;
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
private System.ComponentModel.Container components = null;
public Form1()
{
InitializeComponent();
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.messageView1 = new dcwsolutions.MessageView.MessageView();
this.messageViewPanel1 = new dcwsolutions.MessageView.MessageViewPanel();
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
this.SuspendLayout();
//
// messageView1
//
this.messageView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.messageView1.BackColor = System.Drawing.Color.White;
this.messageView1.BackgroundImageRepeat = dcwsolutions.MessageView.RepeatEnum.Repeat;
this.messageView1.ContextMenuMode = dcwsolutions.MessageView.ContextMenuMode.MessageView;
this.messageView1.DisplayMode = dcwsolutions.MessageView.DisplayMode.Html;
this.messageView1.Font = new System.Drawing.Font("Courier New", 10F);
this.messageView1.ForeColor = System.Drawing.Color.Black;
this.messageView1.Location = new System.Drawing.Point(0, 40);
this.messageView1.Name = "messageView1";
this.messageView1.OpenNewWindow = true;
this.messageView1.Show3DBorder = true;
this.messageView1.ShowScrollBars = true;
this.messageView1.Size = new System.Drawing.Size(736, 496);
this.messageView1.TabIndex = 0;
//
// messageViewPanel1
//
this.messageViewPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.messageViewPanel1.BoundMessageView = null;
this.messageViewPanel1.Location = new System.Drawing.Point(0, 0);
this.messageViewPanel1.Name = "messageViewPanel1";
this.messageViewPanel1.Size = new System.Drawing.Size(736, 40);
this.messageViewPanel1.TabIndex = 1;
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem1});
//
// 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.Text = "Open message file...";
this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(736, 541);
this.Controls.Add(this.messageViewPanel1);
this.Controls.Add(this.messageView1);
this.Menu = this.mainMenu1;
this.Name = "Form1";
this.Text = "MessageView Sample";
this.ResumeLayout(false);
}
#endregion
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void menuItem2_Click(object sender, System.EventArgs e)
{
System.Windows.Forms.OpenFileDialog dialog = new System.Windows.Forms.OpenFileDialog();
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
//Show the message specified by the filenam, use Hybrid Cachemode, in synchronous mode.
messageView1.ShowMessage(System.IO.File.OpenRead(dialog.FileName), CacheMode.Hybrid, false);
}
}
}
}