Click here to Skip to main content
15,888,286 members
Home / Discussions / C#
   

C#

 
GeneralRe: Fingerprint student attendance Pin
Nareen Nair29-Jan-16 23:28
Nareen Nair29-Jan-16 23:28 
GeneralRe: Fingerprint student attendance Pin
Richard MacCutchan29-Jan-16 23:54
mveRichard MacCutchan29-Jan-16 23:54 
GeneralRe: Fingerprint student attendance Pin
Nareen Nair31-Jan-16 1:03
Nareen Nair31-Jan-16 1:03 
GeneralRe: Fingerprint student attendance Pin
Richard MacCutchan31-Jan-16 1:56
mveRichard MacCutchan31-Jan-16 1:56 
GeneralRe: Fingerprint student attendance Pin
Nareen Nair31-Jan-16 19:20
Nareen Nair31-Jan-16 19:20 
QuestionHow to reference a deletegate to a static member of each Form Pin
alamdarAfridi1-Jan-16 23:45
alamdarAfridi1-Jan-16 23:45 
AnswerRe: How to reference a deletegate to a static member of each Form Pin
OriginalGriff2-Jan-16 0:41
mveOriginalGriff2-Jan-16 0:41 
AnswerRe: How to reference a deletegate to a static member of each Form Pin
BillWoodruff2-Jan-16 1:10
professionalBillWoodruff2-Jan-16 1:10 
It's a mistake to place any Control on the MDIParent Form surface: it will then appear above all MDI Windows that may be "under" it, and make a visual mess. If you must have a Button, place it in a MenuStrip on the MDIParent Form.

One way to get the "implicit" functionality you describe is to define an Extension Method on the Form Class for printing:
C#
using System;
using System.Windows.Forms;

namespace YourMDINameSpace
{
    public static class FormExtensions
    {
        public static void Form_Print(this Form form)
        {
            Console.WriteLine("{0} is printing now", form.Name);
            // generic printing code goes here
        }
    }
}
If you drag-drop a MenuStrip onto the MDIParent Form, you can then choose the option for it to insert the standard items which will include a 'File Menu with a 'Print sub-menu item. By defining an EventHandler for that 'Print menu-item, you can write your code that handles printing:
C#
private void printToolStripMenuItem_Click(object sender, EventArgs e)
{
    if(ActiveMdiChild != null) ActiveMdiChild.Form_Print();
}
The code shown here assumes you have implemented the Extension shown above; note that you use the 'ActiveMDIChild directly to invoke the method.
«Tell me and I forget. Teach me and I remember. Involve me and I learn.» Benjamin Franklin


modified 2-Jan-16 7:24am.

GeneralRe: How to reference a deletegate to a static member of each Form Pin
Pete O'Hanlon5-Jan-16 21:32
mvePete O'Hanlon5-Jan-16 21:32 
AnswerRe: How to reference a deletegate to a static member of each Form Pin
Pete O'Hanlon2-Jan-16 2:35
mvePete O'Hanlon2-Jan-16 2:35 
SuggestionRe: How to reference a deletegate to a static member of each Form Pin
Richard Deeming4-Jan-16 3:21
mveRichard Deeming4-Jan-16 3:21 
GeneralRe: How to reference a deletegate to a static member of each Form Pin
Pete O'Hanlon4-Jan-16 3:25
mvePete O'Hanlon4-Jan-16 3:25 
QuestionDataBase Connection to IValueConverter Pin
Andre Dieme1-Jan-16 22:28
Andre Dieme1-Jan-16 22:28 
AnswerRe: DataBase Connection to IValueConverter Pin
Pete O'Hanlon2-Jan-16 5:41
mvePete O'Hanlon2-Jan-16 5:41 
QuestionGradient Colors in Memory Pin
Avoli31-Dec-15 8:02
Avoli31-Dec-15 8:02 
AnswerRe: Gradient Colors in Memory Pin
Ravi Bhavnani31-Dec-15 8:29
professionalRavi Bhavnani31-Dec-15 8:29 
AnswerRe: Gradient Colors in Memory Pin
BillWoodruff1-Jan-16 20:59
professionalBillWoodruff1-Jan-16 20:59 
QuestionEmail with Mailchimp Pin
balaji201030-Dec-15 21:32
balaji201030-Dec-15 21:32 
AnswerRe: Email with Mailchimp Pin
Richard MacCutchan30-Dec-15 21:46
mveRichard MacCutchan30-Dec-15 21:46 
GeneralRe: Email with Mailchimp Pin
balaji20104-Jan-16 4:15
balaji20104-Jan-16 4:15 
AnswerRe: Email with Mailchimp Pin
Marco Bertschi1-Jan-16 5:59
protectorMarco Bertschi1-Jan-16 5:59 
GeneralMessage Closed Pin
30-Dec-15 17:45
Member 1223717030-Dec-15 17:45 
AnswerRe: Need people for project Pin
Anurag Gandhi30-Dec-15 18:31
professionalAnurag Gandhi30-Dec-15 18:31 
QuestionDataSet object not being reconized inside dataview constructor Pin
Member 1144944730-Dec-15 5:55
Member 1144944730-Dec-15 5:55 
AnswerRe: DataSet object not being reconized inside dataview constructor Pin
Richard Andrew x6430-Dec-15 6:23
professionalRichard Andrew x6430-Dec-15 6:23 

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.