|
Hi,
I have an application in which there there is an MDI form and all other are its child. But when i try to show one specific form as its child, it does not appear. And also its Load event also does not fire. This form gets appeared from one location but not from any other location.
Can you please give me hint why it is so? Your help would be highly appreciated.
Regards,
Wasif Ehsan.
|
|
|
|
|
set the MdiParent property of the childforms to the mainform..
ChForm frm = new ChForm();<br />
frm.MdiParent = this;<br />
frm.Show();
life is study!!!
|
|
|
|
|
Good day,
How can I make a UserControl inherits from a Form?
I've tried to do this:
public partial class UserControl1 : Form
{
..
}
But when I add a the dll to my test program, I could not find UserControl1 from the listed control and a message appears indicating the no control exist.
Thanks.
-- modified at 5:09 Tuesday 27th February, 2007
|
|
|
|
|
If you want to use your UserControl1 as a UserControl, then you must inherits it from Class UserControl. You cannot create a new usercontrol inherits from a Form.
|
|
|
|
|
The reasoN why i want to create a usercontrol that is derived from a form because i want to create customable panel, that can be minimize or maximize. i've made a usercontrol which is derived from Panel but the problem is when the backcolor of the control is transparent and that control is placed inside my usercontrolpanel, the transparency goes through all the way to the form, that is why i thought i should derived my usercontrol from a form. Please refer to the image linke below for sample output of my usercontrol:
http://www.geocities.com/fritzjeran/SAMPLEOUTPUT.JPG
Any suggestion is appreciated.
Thanks.
|
|
|
|
|
fjlv2005 wrote: customable panel, that can be minimize or maximize
That's easy, you just set the dock style of the control to all, to maximise on the form. Set it to none and the size to 0,0 to minimise.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
how to select a particular erroritem in the errolist and also it description
|
|
|
|
|
kalyanit wrote: how to select a particular erroritem in the errolist and also it description
Sorry, there is some context missing. What are you talking about? Where is this error list?
|
|
|
|
|
Hi All,
I have 2 exe's.What I have to do is to call one exe from the second one with some arguments.How to do it??
NEHA GUPTA
|
|
|
|
|
|
Take a look at the Process.Start method.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hello,
In the namespace System.Diagnostics you will find Process and ProcessStartInfo.
ProcessStartInfo psi= new ProcessStartInfo();
psi.UseShellExecute = false;
psi.FileName = ???;
psi.WorkingDirectory = ???;
psi.Arguments = @"xxx";
using(Process YourProcess= Process.Start(psi))
{
YourProcess.???;
}
All the best,
Martin
|
|
|
|
|
I need to load large string into RichTextBox.This string is RTF formatted text.If I try passing that string to RichTextBox like:
RichTextBox.Rtf=that string
RichTextBox freeze for several secounds.
I search over internet for solution,and i found article that describe how to load file that is a few megs in size using EM_STREAMIN message.
Unfortunatelly,that article is for VB6 and use file for loading while I have to use RTF formatted string.
Does anybody knows how to implement loading string into RTB using EM_STREAMIN message in C#?
|
|
|
|
|
use threads to solve ut problem
|
|
|
|
|
use threads to solve your problem
|
|
|
|
|
Sorry to say but did you think about this reply before posting?
The original poster claims that the RichTextBox itself is freezing.
If you can tell us how to use threads to keep this from happening (don't forget the UIThread has to render the RichTextBox!), you're my hero...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Sure, create a new RichTextBox, load it in the background thread, then substitute it
for your existing RTB.
|
|
|
|
|
Yes,that could help,but in that case user must wait until whole string is loaded into new RichTextBox before it is substituted with existing RichTextBox.
Is it possible to load RTF file or string in segments into RichTextBox.
Something similar to MS Word or WordPad
where text is appended in RichTextBox in segments while app remain responsible to user.
I asking that because RichTextBox doesn't have "append" method.
|
|
|
|
|
Hi!
Unfortunately, I don't see an easy solution for you. But if you somehow can split the RTF into smaller parts, you could load them one after the other by using the SelectedRtf property and at least throw in a few Application.DoEvents() so that the RTB updates after each loaded part.
The idea behind this is something like this:
rtb.Clear();
for (int i=0; i<parts.Length; i++)
{
rtb.SelectedRtf = parts[i];
rtb.Select(rtb.Text.Length, 0);
Application.DoEvents();
}
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
the boy is right .. no offence .. but check your premise
|
|
|
|
|
Ok, then please show us a working example. If you don't use a workaround like the one suggested by Luc (which isn't what the poster was asking for and, honestly, I'd rather call cheating :P), I really can't see how this should work.
Sure, "use threads" is the default answer when someone ask for making something more responsive, but in this case it's a Control that can become unresponsive for a longer period of time due to calling one of its methods (or setting one of its properties).
With very few exceptions (and calling LoadFile() or setting Rtf don't belong to them) you cannot safely access a control from another thread than the one it was created on.
So if you create the RTB in another thread (apart from the UIThread), then you'll have to marshal each and every call to this other thread.
But even so: You're calling LoadFile() from the other thread and the RTB is blocking the other thread while the large file is being loaded. During this period of time the RTB doesn't update and thus appears unresponsive.
Out of curiosity I actually tried the "create the RTB in another thread" approach and, apart from proving my point, I also found that even the UIThread seems to be blocked while the RTB is loading a large file in a background thread...
If you're interested, I can post the code here.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
give me your Email ID i'll mail you solution
|
|
|
|
|
Please use the Email link from one of my postings to send me a PM with your mail adress. I couldn't send you one because CP claims that your mail adress isn't verified.
Thanks in advance, I'd be very interested in a working solution for loading a large RTF string/file into a RTB without blocking it in the process...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Boy O Boy... this is not valid excuses.....
i saw your profile might be you are summa cum laude but this time you are not using your wit.
here is no facility provided by CP to send any attachment and writing an artical is a real pain in ass. you can take my ID
think2sameer@yahoo.com
wright70@mailcity.com
i am available on both
|
|
|
|
|
Nobody asked you to send an attachment via CP.
I asked you to send me a personal message with your mail adress so I don't have to write my mail adress here and attact even more spam than I already receive and allow you to do the same.
I'm really sorry if you didn't understand...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|