Click here to Skip to main content
15,890,512 members
Home / Discussions / C#
   

C#

 
QuestionRe: How to send/recieve objects with sockets? Pin
Chesnokov Yuriy31-Oct-09 8:55
professionalChesnokov Yuriy31-Oct-09 8:55 
QuestionGiving range to Run time end and start date parameter Pin
haleemasher30-Oct-09 23:53
haleemasher30-Oct-09 23:53 
QuestionUsing Connectionstring Pin
haleemasher30-Oct-09 23:52
haleemasher30-Oct-09 23:52 
AnswerRe: Using Connectionstring Pin
OriginalGriff31-Oct-09 0:46
mveOriginalGriff31-Oct-09 0:46 
GeneralRe: Using Connectionstring Pin
Keith Barrow31-Oct-09 3:03
professionalKeith Barrow31-Oct-09 3:03 
QuestionHow to access mdi parent's menustrip items from a child form [modified] Pin
idan_bismut30-Oct-09 21:58
idan_bismut30-Oct-09 21:58 
AnswerRe: How to access mdi parent's menustrip items from a child form Pin
idan_bismut30-Oct-09 22:37
idan_bismut30-Oct-09 22:37 
GeneralRe: How to access mdi parent's menustrip items from a child form Pin
OriginalGriff30-Oct-09 23:37
mveOriginalGriff30-Oct-09 23:37 
THat is not a good idea - it works, but it is considered bad practice. Why? Because it locks the child form to the design of the parent form. You cannot now change the design of the parent form unless you check that this will have no effect on the child form.

The recommended way to do this is to generate an event in the child form which is subscribed to and handled by the parent form. The parent form then takes the action depending on what controls it is using.

To do this:
In the child form:
public partial class frmChild : Form
   {
   // Signal file change happened
   public event EventHandler Changed;

   protected virtual void OnChanged(EventArgs e)
      {
      EventHandler eh = Changed;
      if (eh != null)
         {
         eh(this, e);
         }
      }

   private void DoSomethingToChangeData()
      {
      OnChanged(null);
      }
   }

----- The assign to eh is in case the handler changes between null check and exec. (Unlikely, but possible)

----- The null check is to ensure there is a handler. If not, better to ignore it gracefully, than to rely on the thrown exception (NullReferenceException)

In the Parent form:
public frmParent()
    {
    frmChild.Change += new frmChange.ChangeHandler(Changed);
    }

//
// Fired when the file is changed at a lower level.
//
private void Changed(object sender, EventArgs e)
    {
    }


No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.

This message is made of fully recyclable Zeros and Ones

GeneralRe: How to access mdi parent's menustrip items from a child form Pin
idan_bismut31-Oct-09 3:47
idan_bismut31-Oct-09 3:47 
GeneralRe: How to access mdi parent's menustrip items from a child form Pin
Member 1312346617-May-17 20:20
Member 1312346617-May-17 20:20 
QuestionHow to Register mshtml dll in to GAC ? Urgent. Pin
Jacobb Michael30-Oct-09 20:29
Jacobb Michael30-Oct-09 20:29 
AnswerRe: How to Register mshtml dll in to GAC ? Urgent. Pin
Christian Graus30-Oct-09 20:32
protectorChristian Graus30-Oct-09 20:32 
GeneralRe: How to Register mshtml dll in to GAC ? Urgent. Pin
Jacobb Michael30-Oct-09 20:43
Jacobb Michael30-Oct-09 20:43 
AnswerRe: How to Register mshtml dll in to GAC ? Urgent. Pin
Jacobb Michael31-Oct-09 0:52
Jacobb Michael31-Oct-09 0:52 
GeneralRe: How to Register mshtml dll in to GAC ? Urgent. Pin
Christian Graus31-Oct-09 0:53
protectorChristian Graus31-Oct-09 0:53 
QuestionHow to monitor the speed of writting into or reading out from the hard disk? Pin
sinron30-Oct-09 20:17
sinron30-Oct-09 20:17 
AnswerRe: How to monitor the speed of writting into or reading out from the hard disk? Pin
Christian Graus30-Oct-09 20:33
protectorChristian Graus30-Oct-09 20:33 
GeneralRe: How to monitor the speed of writting into or reading out from the hard disk? Pin
sinron30-Oct-09 23:07
sinron30-Oct-09 23:07 
GeneralRe: How to monitor the speed of writting into or reading out from the hard disk? Pin
Christian Graus31-Oct-09 0:54
protectorChristian Graus31-Oct-09 0:54 
GeneralRe: How to monitor the speed of writting into or reading out from the hard disk? Pin
Eddy Vluggen31-Oct-09 1:04
professionalEddy Vluggen31-Oct-09 1:04 
Questionis this a cache problem or what? Pin
niranjanR30-Oct-09 18:22
niranjanR30-Oct-09 18:22 
AnswerRe: is this a cache problem or what? Pin
Christian Graus30-Oct-09 19:17
protectorChristian Graus30-Oct-09 19:17 
GeneralRe: is this a cache problem or what? Pin
niranjanR30-Oct-09 19:44
niranjanR30-Oct-09 19:44 
GeneralRe: is this a cache problem or what? Pin
Christian Graus30-Oct-09 20:07
protectorChristian Graus30-Oct-09 20:07 
GeneralRe: is this a cache problem or what? Pin
niranjanR30-Oct-09 20:24
niranjanR30-Oct-09 20:24 

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.