|
Read the design code and make sure you have added the child to the mdi and not into the panel. If you have placed it into the panel and your making the panel invisible, the child form will also be invisible.
|
|
|
|
|
i am doing this.
childF.MdiParent=this;
"this" refers to parent form which is MDI
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Okay that does not help much. Paste some more code and we can help you. How are you calling the child form? How are you showing it? There are many ways this can be done and we have no idea how YOU are doing it.
|
|
|
|
|
Here i have the complete code
[code]
Form1 f=new Form1();
f.MdiParent=this;
f.BringToFront();
f.Show();
[/code]
"this" points to Form which MDI.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Hi i had a project to create an SMS Gateway. They will add multiple modems after implementation so i want to include load balancing for all those modems. It is fine to use round robin to do the load balancing but how will my program identify if they add one more modem? they will just enter the modem configuration manually into a pre - created text file. So my program should identify if there is a new modem added from the text file and do load balancing accordingly. How can i acheive this??
|
|
|
|
|
hi !!!!!!!!!
i want to know how to write code on system shut down event
Azad Yadav
|
|
|
|
|
Check the documentation for the windows messages WM_QUERYENDSESSION and WM_ENDSESSION .
«_Superman_»
|
|
|
|
|
Handle the FormClosing event. It gives you the close reason.
void YourForm_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason == CloseReason.WindowsShutDown)
{
}
}
|
|
|
|
|
|
typedef vector <addresstoken*> ADDRESS_TOKENS_VECTOR;
AddressToken is a predefined structure
can anyone explain the above code
the quieter u become more u hear
|
|
|
|
|
This is a C++ question, not C#. Anyhow, typedef is used in C and C++ to give a type a new name and is often done for clarity purposes. I think what the code is doing is creating a vector of type addresstoken pointers and its given a succint name as ADDRESS_TOKENS_VECTOR.
|
|
|
|
|
C# doesn't support typedef .
|
|
|
|
|
You can use the "using" directive to do that. For example
using MyList = System.Collections.Generic.List<int>;
Regards
Senthil [MVP - Visual C#]
_____________________________
My Home Page |My Blog | My Articles | My Flickr | WinMacro
|
|
|
|
|
Hi guys,
I have a question which I am not sure how to put it exactly. I have a method DoTask: when DoTask is completed, it will fire up a TaskCompleted event which will invoke the OnTaskCompleted method, however if it is some more tasks to be done, OnTaskCompleted will call DoTask. This cycle keeps repeating until there is no more task. What I am afraid, is event calling is synchronous, meaning DoTask calls OnTaskCompleted and OnTaskCompleted calls DoTask, it is being done recursively, it may run out of stack memory as the user may be running my application for a long time.
Is event calling done in the caller or it is dispatched to be done at a later time?
Thank you very much!
|
|
|
|
|
Wong Shao Voon wrote: Is event calling done in the caller or it is dispatched to be done at a later time?
Not sure what you mean. Please elaborate. Does DoTask to the same thing everytime? How do you decide when it will not be called again?
Maybe there is a better solution if you tell us what it is you are trying to do.
|
|
|
|
|
Hi Yoshi,
DoTask is not called again if there is nothing to be downloaded because the list of files is empty. The scenario is complicated because I simplified in the previous post. You can say DoTask() does not do the same thing, if the location of the file is http, it will download from that url using http API. If the location of the file is ftp, it will download from that url using ftp API. If it is local or UNC path, DoTask will just copy from that location.
|
|
|
|
|
Wong Shao Voon wrote: OnTaskCompleted method, however if it is some more tasks to be done, OnTaskCompleted will call DoTask.
That doesn't looks like a good design. How about moving this logic to DoTask method? DoTask method has to fire TaskCompleted event when it finishes each task, it then checks for more tasks. Something like
while(isThereMoreTask()){
} .
|
|
|
|
|
Hi Navaneeth,
DoTask is doing its work asynchronously, that is it returns immediately after creating a thread. Can anyone answer my question that event invoking is done in the caller or done/called at a later time by the CLR?
Thanks!
|
|
|
|
|
Hi,
in order to execute multiple tasks sequentially I prefer using a Queue.
With a queue, there is no recursion, it boils down to a simple loop:
while(there is work to do) do it;
Luc Pattyn [Forum Guidelines] [My Articles]
I use ListBoxes for line-oriented text output (not TextBoxes), and PictureBoxes for pictures (not drawings).
modified on Friday, June 10, 2011 12:16 PM
|
|
|
|
|
DoTask is a asynchronous task, it spawn a thread to do its stuff and return immediately. It is not sure when it is finished. The completion of the task is notified though OnTaskComplete.
|
|
|
|
|
Wong Shao Voon wrote: DoTask is a asynchronous task, it spawn a thread to do its stuff and return immediately
That doesn't make any difference. You still can use a queue and execute the jobs from the queue. If the queue is empty consider all the job done. You can make this queue accessible to all the threads so that other threads can enqueue new tasks.
|
|
|
|
|
right.
just make sure to provide some synchronization (say a lock) so the queue doesn't get messed up.
Luc Pattyn [Forum Guidelines] [My Articles]
I use ListBoxes for line-oriented text output (not TextBoxes), and PictureBoxes for pictures (not drawings).
modified on Friday, June 10, 2011 12:17 PM
|
|
|
|
|
That's correct
|
|
|
|
|
Wong Shao Voon wrote: Is event calling done in the caller or it is dispatched to be done at a later time?
Event firing is synchronous i.e. performed on the thread that fires the event.
However, if DoTask is asynchronous, then it will run on a different thread and therefore you won't get into infinite recursion.
DoTask -> TaskCompleted -> OnTaskCompleted -> Method End
|-> DoTask -> TaskCompleted ....
|
|
|
|
|
Hi
There is a peculiar requirement of copying in clipboard data as an OLE object into a RichTextBox.
I am using the clipboard object to retrieve the contents in an rtf format.
this.richTextBox1.SelectedRtf = Clipboard.GetData(System.Windows.Forms.DataFormats.Rtf).ToString();
Is it possible to copy the clipboard data as OLE object rather than an rtf.
Regards
Gaurav
|
|
|
|