Click here to Skip to main content
15,899,475 members
Home / Discussions / C#
   

C#

 
QuestionMoving to a Managed World Pin
Robert M Greene19-Oct-05 8:25
Robert M Greene19-Oct-05 8:25 
AnswerRe: Moving to a Managed World Pin
Judah Gabriel Himango19-Oct-05 10:22
sponsorJudah Gabriel Himango19-Oct-05 10:22 
AnswerRe: Moving to a Managed World Pin
Matt Gerrans19-Oct-05 19:55
Matt Gerrans19-Oct-05 19:55 
QuestionCreating an image from a picturebox Pin
budidharma19-Oct-05 8:05
budidharma19-Oct-05 8:05 
AnswerRe: Creating an image from a picturebox Pin
turbochimp19-Oct-05 18:23
turbochimp19-Oct-05 18:23 
Questioncall a method on a parent form Pin
Sled Dog19-Oct-05 8:04
Sled Dog19-Oct-05 8:04 
AnswerRe: call a method on a parent form Pin
Rick Beideman19-Oct-05 8:34
Rick Beideman19-Oct-05 8:34 
AnswerRe: call a method on a parent form Pin
MoustafaS19-Oct-05 11:36
MoustafaS19-Oct-05 11:36 
You may ( for further use ) create an event on the usercontrol itself which may be this_DataChanged and it tracks all the changes that may have been done , and then in every parent you add this control in you just handle it.
ex:

////UserControl
public class MyControl : UserControl
{
    public MyControl() { }
    public event EventHandler DataAdded;
    ////All the properties that you want to track must be like this.
    public DataType PropertyName
    {
        get { return dataField; }
        set { this.dataField = value; this.OnDataAdded(); }
    }
    ////And this is the method taht will fire the event.
    private void OnDataAdded(object sender, EventArgs e)
    {
        if (this.DataAdded != null)
        {
            this.DataAdded(this.DataAdded, e);
        }
    }
}
////ParentForm
public class MyForm : Form
{
    ////Regular Methods and Fields.

    ////In the Init Method :
    this.MyInheritedUserControl.DataAdded+=new EventHandler(this.MyEventHandler);
}

hope this helps.


"I am a liar." Is this statement true or false ?



GeneralRe: call a method on a parent form Pin
Sled Dog20-Oct-05 1:10
Sled Dog20-Oct-05 1:10 
QuestionHow to add a NumericUpDown control to MenuItem Pin
eradj19-Oct-05 7:43
eradj19-Oct-05 7:43 
QuestionUnable to set picturebox visible property to true, but it displays the image anyway. Pin
Dan Neely19-Oct-05 7:35
Dan Neely19-Oct-05 7:35 
QuestionHow to free the display of the form/control? SuspendLayout() can not work. Pin
zhyluopro19-Oct-05 7:24
zhyluopro19-Oct-05 7:24 
QuestionMouse X,Y coordinates in window ... Pin
budidharma19-Oct-05 7:20
budidharma19-Oct-05 7:20 
AnswerRe: Mouse X,Y coordinates in window ... Pin
SimonS19-Oct-05 8:34
SimonS19-Oct-05 8:34 
GeneralRe: Mouse X,Y coordinates in window ... Pin
budidharma19-Oct-05 9:24
budidharma19-Oct-05 9:24 
QuestionHosting foreign control in DataGridView .net 2.0 Pin
Member 205198019-Oct-05 6:31
Member 205198019-Oct-05 6:31 
QuestionReaderWriterLock Pin
ChrisAdams19-Oct-05 6:02
ChrisAdams19-Oct-05 6:02 
QuestionXmlDataDocument and null values Pin
the last free name19-Oct-05 5:21
the last free name19-Oct-05 5:21 
AnswerRe: XmlDataDocument and null values Pin
Robert M Greene19-Oct-05 8:47
Robert M Greene19-Oct-05 8:47 
GeneralRe: XmlDataDocument and null values Pin
Robert M Greene19-Oct-05 8:49
Robert M Greene19-Oct-05 8:49 
QuestionOpening child forms without focus Pin
Hitesh Salian19-Oct-05 4:48
Hitesh Salian19-Oct-05 4:48 
AnswerRe: Opening child forms without focus Pin
kmuthuk9-Jan-07 9:06
kmuthuk9-Jan-07 9:06 
QuestionHow to determine hard drives? Pin
wasife19-Oct-05 4:25
wasife19-Oct-05 4:25 
AnswerRe: How to determine hard drives? Pin
Judah Gabriel Himango19-Oct-05 5:22
sponsorJudah Gabriel Himango19-Oct-05 5:22 
AnswerRe: How to determine hard drives? Pin
leppie19-Oct-05 5:55
leppie19-Oct-05 5:55 

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.