dsoframer.ocx and OnFileCommand using C#

R

raj

I am using dsoFramer.ocx in my appliaction. the problem is OnFileCommand not
getting fired
here is my code
----------------------------------------
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace WindowsApplication2
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private AxDSOFramer.AxFramerControl axFramerControl1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;

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

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

/// <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()
{
System.Resources.ResourceManager resources = new
System.Resources.ResourceManager(typeof(Form1));
this.axFramerControl1 = new AxDSOFramer.AxFramerControl()
((System.ComponentModel.ISupportInitialize)(this.axFramerControl1)).BeginInit();
this.SuspendLayout();
//
// axFramerControl1
//
this.axFramerControl1.Enabled = true;
this.axFramerControl1.Location = new System.Drawing.Point(32, 88);
this.axFramerControl1.Name = "axFramerControl1";
this.axFramerControl1.OcxState =
((System.Windows.Forms.AxHost.State)(resources.GetObject("axFramerControl1.OcxState")));
this.axFramerControl1.Size = new System.Drawing.Size(208, 160);
this.axFramerControl1.TabIndex = 0;
this.axFramerControl1.OnFileCommand += new
AxDSOFramer._DFramerCtlEvents_OnFileCommandEventHandler(this.axFramerControl1_OnFileCommand);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.Add(this.axFramerControl1);
this.KeyPreview = true;
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load)
((System.ComponentModel.ISupportInitialize)(this.axFramerControl1)).EndInit();
this.ResumeLayout(false);

}
#endregion

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

private void Form1_Load(object sender, System.EventArgs e)
{
axFramerControl1.Open(@"c:\test.rtf")
axFramerControl1.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFileSave,false)
axFramerControl1.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFilePrint,false)
axFramerControl1.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFileOpen,false)
axFramerControl1.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFileSaveAs,false );

}

private void axFramerControl1_OnFileCommand(object sender,
AxDSOFramer._DFramerCtlEvents_OnFileCommandEvent e)
{
if (e.item == DSOFramer.dsoFileCommandType.dsoFileSave)
{
// do some thing
}
}
}
}



------------------

can you Please someone find , what is wrong in my code?

Thanks
Raj
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top