Custom component as private member of parent form

H

hassan

Hi,
I have develope a custom component i want this component as private
member of parent form but i can't. My component declared in
InitializeControls() function of designer.Thanx in advance for help.
 
H

hassan

Hi Chanmm,
This is my code.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Windows.Forms.Design;
using System.Reflection;
using System.ComponentModel.Design.Serialization;
using System.IO;
using System.Collections;

namespace MyCtrl
{


[DesignerSerializer(typeof(MyCtrlSerializer),
typeof(CodeDomSerializer)),MergableProperty(true)]
[Designer(typeof(Designer.MyCtrlDesigner)), ToolboxItem(true)]
public class MyCtrlMgr : Component, ISupportInitialize
{

#region Constructor

public SearchBindingMgr()
{
InitializeComponent();
}


#endregion

#region Methods

private void InitializeComponent()
{
_bDesingMode = DesignMode;
}


#endregion

#region ISupportInitialize Method

public virtual void BeginInit()
{
}
public virtual void EndInit()
{
}

#endregion



#region Properties

[EditorBrowsable(EditorBrowsableState.Never), Browsable(false),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Control ParentControl
{
get
{
return _parentControl;
}
set
{
_parentControl = value;
}

}

public bool Mode
{
get
{
return base.DesignMode;
}
}
public static bool DesignTime
{
get
{
return _bDesingMode;
}
set
{
_bDesingMode = value;
}
}

#endregion

#region Attributes


private Control _parentControl;
private static bool _bDesingMode;
}

Thanx in advance for ur help.
 

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