|
I'm in the process of writing a program that has many MDI children to it. Some of the functions for each child are the same, such as close and print. Where I have the problem is getting a print option to work correctly.
I've looked at creating a File -> Print menu option in the MDI parent but I can't figure out how to get that to point to a proceedure in the MDI child (with the though that each child would have a proceedure with that name.) I can't figure out how to do this though.
The other option I looked at was to make a MainMenu on the parent with some items, and then have child-related item in a MainMenu item on the child form. The problem I am having with this approach is that I have File -> Close on the parent and when I try to add a File -> Print on the child, it creates two file menus. I've tried every combination of MergeType and MergeOrder I can think of in both the parent and child menus.
Is there something simple that I'm missing. I would think what I'm trying to accomplish here is pretty common. Any help would be greatly appreciated.
--In a world without fences, who needs Gates?
|
|
|
|
|
SignMan359 wrote:
I've looked at creating a File -> Print menu option in the MDI parent but I can't figure out how to get that to point to a proceedure in the MDI child (with the though that each child would have a proceedure with that name.) I can't figure out how to do this though.
I think that you are overcomplicating it. You don't need to implement a print method in every child window. You need to implement your print method in the MDI Parent code and have it print only the contents of the active child window (which ever child window has the focus).
|
|
|
|
|
Don't worry about all the menu merging and stuff. Just put a Print item in the File menu. In it's Click handler, you reference the active MDI child window by using the ActiveMdiChild property of the MDI Parent window, where your menu is. All you need to do to call the Print method of your child form is:
Form myChildForm = this.ActiveMdiChild;
myChildForm.Print();
This will call the Print method on whatever child form currently has the focus.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have an application that consists of a main windows form and a 2nd thread that handles communications back to a server. Based on a command stream from the server the main thread starts other windows forms that share an event/notification message structure.
Since each of the newly created windows forms totally control the UI and handle messages related to the tool passed through the event system I wanted to run each on an independent UI thread instead of having all windows running off of the single main UI thread.
In playing around with this I have not found any examples and have been unsuccesful at trying to figure out a structure that would do what I'm trying to accomplish.
Any suggestions or pointers.
Thanks
Neil Lamka
neil@meetingworks.com
|
|
|
|
|
This will do the trick
void UIThread()
{
Form yourForm = new Form();
Application.Run(yourForm);
}
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks much, I'll give that a try.
Neil Lamka
neil@meetingworks.com
|
|
|
|
|
hi.what I asked to do is editing image with .net like user uploads an image-for example his photo..then he wants to make his eye color green.he selects green and posts code..on the server my code finds eye and changes its color.[*-)] I hope you guys can understand that..can I do this with Image class or another one?any examples or links would be great if possible.thanks..
|
|
|
|
|
I might be misunderstanding you but try looking at examples that put a watermark on images. A lot of websites use this technique to create their logo on images that users upload to their website. Pretty much what happens is that the image usually doesn't get altered but when the image gets rendered on the webpage text (or a logo) is superimposed onto the image. Check out this link: This will show you how to create a quick and dirty way to brand your images using ASP and GDI.
http://labs.insert-title.com/labs/article832.aspx
|
|
|
|
|
thanks..that may work for me..can I or how can I detect a specific area on image?for example if it is someone's photo,and I want to detect the coordinates of his eyes..
|
|
|
|
|
Detecting objects in a photograph is a challenge. Do a search for "Computer Vision" or talk to your Computer Science professor at your local university to see how complex a field this is. Unfortunately I can't think of a simple way of doing this.
|
|
|
|
|
Does anyone know any reliable compression library for .net ? Tried to use SharpZlib without success (too much CRC errors)... I tryed managedzlib as well. If anyone know a good library (or a way to call the good and old unmanaged zlib from managed enviroment), please let me know.
|
|
|
|
|
Just for the record, this post is mine (I tought I was logged on when I posted).
Mauricio Ritter - Brazil
MSN: mauricioritter(atsign)hotmail.com
English is not my native language so, if you find any spelling erros in my posts, please let me know.
|
|
|
|
|
|
Hi everyboy,
I am now developing a piece of software to interact with a web cam. I have already found some examples of web cam accesses, but I would like to know how to access the configuration of the webcam.
It is important for my project to be able to have control of the acquisition of the pictures. Any idea?
McArco
Newbie in C#
|
|
|
|
|
Hi,
I'm writing a service which would extract plain text between HTML tags. e.g <td>Some text</td>
It will extract all tags like this. Iam using following regular expression
Pattern = ">\w+[^<]+<"
It tries to extract only those tags which contain only plain text and on other.
This regular expression is not working fine and does not extract all tags e.g it misses <title>My title</title>
I would appreciate if someone could help me. Its urgent.
|
|
|
|
|
|
Hi,
I'm writing a service which would extract plain text between HTML tags. e.g Some textIt will extract all tags like this. Iam using following regular expression
Pattern = ">\w+[^<]+<"
It tries to extract only those tags which contain only plain text and on other.
This regular expression is not working fine and does not extract all tags e.g it misses <title>My title
I would appreciate if someone could help me. Its urgent.
|
|
|
|
|
What about "<.*?>([^<>]*)</.*?>" ?
But I quite don't understand your example with <br><br> ...
David
p.s try check "do not threat <'s as HTML tags" or escape every < and > in text
|
|
|
|
|
Hey everybody!
I created 2 forms, the MAIN form and SECOND form.
the SECOND form has a text box (tbTEXT), and I want to use that text (tbTEXT.text) in the MAIN form.
the question is how do I tell C# to address that item (tbTEXT) from the MAIN form?
or if I will put it in a more general way, how can I control variables (or items) in one form from another?
THANKS!
|
|
|
|
|
A Form is just another class. You can expose a property in the second form. You can store a reference to the second form in main form and then use the property to manipulate tbText. Something like
class SecondForm
{
private TextBox tbText = new TextBox();
public string TbText
{
get { return tbText.Text; }
set { tbText.Text = value; }
}
}
class MainForm
{
SecondForm secondForm;
public void ShowSecondForm()
{
secondForm = new SecondForm();
secondForm.Show();
}
public void SetText(string text)
{
secondForm.TbText = text;
}
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Does anybody know a web site which would explain the actions, verbs and other properties to fill in the FileTypes editor? In searched in MSDN but there are just simple tutorials like "How to add new file document".
|
|
|
|
|
Hi
I wand to develop a tri state Check listed box (That allows tickboxs to be in three states: ticked, unticked and crossed.) for a win form application.
There is no such control in the .Net,
shall any one suggest how to do or shall I get any sample code for the same.
Regards
|
|
|
|
|
Hello, i need your help.
I have painted a circle inside my form and when I minimized it, it disapeared... in vb6 when I'm using PictureBox , I have an option called
"AutoRedrawe", how can I set it here, in c#?
|
|
|
|
|
You could always store the objects in some data structure and draw them on the screen everytime it paints itself.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
C# does not support the VB6 behaviour. It's not a good practice to draw upon the existing graphics of any control. Follow this link[^]for the answer to your problem.
Regards,
Polis
Can you practice what you teach?
|
|
|
|