|
How do i read list of files from a text file in CruiseControl.Net
|
|
|
|
|
Dear all,
I have a problem that I haven't encountered before. I have two forms. I would like to call a method that changes something on another form ( different class ), which happens to be a usercontrol. This my code :
Form A :
private void toolStripButton1_Click(object sender, EventArgs e)<br />
{<br />
UserControlMain cc = new UserControlMain(); <br />
ultraDockManager1.PaneFromControl(cc.webBrowserPanel).Close();<br />
}
This doesn't seem to work. The panel on from B is not close, but the application crashes instead.
If I add a method on Form B , and I invoke the following method directly, it works :
public void CloseWebBrowser()<br />
{<br />
this.ultraDockManager1.PaneFromControl(this.webBrowserPanel).Close();<br />
}
If I try to invoke the method on Form B from Form A by :
private void toolStripButton1_Click(object sender, EventArgs e)<br />
{<br />
UserControlMain cc = new UserControlMain(); <br />
cc.CloseWebBrowser();<br />
}
The application crashes as well.
Can anyone tell me what I'm doing wrong ? Is the behaviour of a UserControl different than to a normal winform.
kind regards,
|
|
|
|
|
Hi,
Rick van Woudenberg wrote: UserControlMain cc = new UserControlMain();
ultraDockManager1.PaneFromControl(cc.webBrowserPanel).Close();
this creates a new UserControlMain, not a reference to the one you probably already had.
I guess it is not sufficiently initialized to support the attempted operation,
I suggest you try to catch the exception that occurs, so you get useful details on it.
YAs a last resource yu may want to enclose your Application.Run() in a try-catch
that dumps the entire Exception.ToString() to a MessageBox.
|
|
|
|
|
I suspected something like that. I will try to catch the exceptions like you told me. Maybe that will shed a little light on the solution. In teh mean time, is it possible to somehow call the Method below on Form B from Form A ? :
public void HidePanelWeb(object sender, EventArgs e)<br />
{<br />
this.ultraDockManager1.PaneFromControl(this.webBrowserPanel).Close();<br />
}
kind regards,
|
|
|
|
|
Hi Rick,
I dont know enough about your app, but I am guessing you may be trapped by an
IllegalCrossThreadCall. Are you by any chance calling this from a thread that is not
the main thread ? If so, read up on Control.InvokeRequired and Invoke().
|
|
|
|
|
Luc,
Thank you for your help though. You basically fixed the problem for me. Your comment : 'maybe it's not referenced properly' got me thinking. Turned out that the object was already referenced in the application. I invoked tthe method and it work perfectly. Once again, thank you for putting me on the right track !!
Cheers
|
|
|
|
|
Hi!
I am using C# 2005, the size of '.exe' file of project in Release folder is increasing day by day as I add functionalities in project and now it is reaching around 2MB...
Can any one tell me whats the reason of this and how to control it? Because normally I dont see such big exe files...
Thanks in advance...
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
Wow! That's quite big. How many lines of code are compiled to make your exe file?
|
|
|
|
|
Code? Bah. Just a few bitmaps as embedded resources would do that easily.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Thanks for reply...
There are approximately 10000 or so lines of code and also 10-15 images/icons...
Is it because of code or images? and whats its solution?
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
It's the images.
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 )
|
|
|
|
|
Thanks for pointing out the problem, can you tell me how can i solve it? or should i let it go like this? will it create efficiency or any other problem...?
Thanks,
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
You could use a seperate resource assembly to contain your images, etc. That would remove them from the exe and give the benefit of allowing them to be updated independent of it. However, I don't see a problem with a 2MB exe. I've seen much larger ones, from code alone.
only two letters away from being an asset
|
|
|
|
|
Thanks Mark!
If this exe wont cause any problem then its good, however I will appreciate if you guide me how to create a separate resource assembly to contain images..
Take Care, Cheers...
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
|
Thanks a lot, hopefully this article will help in getting me started...
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
see here[^]
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Please don't post links inside the same thread.
---
single minded; short sighted; long gone;
|
|
|
|
|
How else would be original poster notified about my (relevant) reply to someone else on that thread?
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
You can easily reference to the post without using a link.
---
single minded; short sighted; long gone;
|
|
|
|
|
And what exactly is so bad about link?
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
How to prevent enter key to focus down row?
When we press enter key, grid move its focus to its down row of the current row. I dont wnat this movement. Please Help for that.
(Is there any property in about case)
Syed Shahid Hussain
|
|
|
|
|
Try this:
private void dgrMyDatagrid(object sender, KeyEventArgs e)
{
if ((e.KeyCode == Keys.Enter)
{
e.Handled = true;
}
}
Hope it helps,
Jure
|
|
|
|
|
Thanks a lot dear friend. It really worked.
Syed Shahid Hussain
|
|
|
|
|