|
It all sounds normal.
Minimizing the main form causes Windows to reclaim part of the Working Set.
Just closing some forms won't achieve anything right away: the GC only runs when it has to, as in your code trying to create a new object and not enough memory being available. Closing a window is unlikely to cause that, unless you create objects in the FormClosing/FormClosed handlers.
|
|
|
|
|
Are You using Thread Under thread ?
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
When the form loads it loads information from SQL. One information that takes a while remotely is a picture. Since the pictures put in there are usually 1-3MB in size. So I use thread to call a method to do this.
Thread newThread = new Thread(new ThreadStart(GetPicture));
newThread.Start();
This is how I call it. The TAG (Identity) is passed to the form when it is loaded from another form. So how I get the picture I want is by using that Tag.
private string TAG;
public EditInventory(string TAG)
{
this.TAG = TAG;
InitializeComponent();
}
|
|
|
|
|
According to ur logic Thread Start Loading picture but at this time Second Thread Starts.So at same time Multiple Threads are Running. So it's take Max CPU Usage and CPU Memory.
You Should remove the concept of thread for GettingPicture. Or when first thread finish then second thread should run.
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
Hi,
I have just come across a problem where i have a block of code which exercutes when the selectedindexchange event kicks in. However, because i load my form becuase i have a datagrid and the combo box is binded the selectedindexchnage event is exercutes again making duplicate data . How do i approach avoiding this?
I have looked at diffrent events but cant see one that wil solves my problem,
any suggestions or simillar examples anyone can point me to?
Many Thanks
D.Arnold
dave1816
|
|
|
|
|
If I have a situation where firing an event causes the event to fire again, or similar, I tend to use a flag to tell me when I want the event firing code to run, and when I need to ignore it.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Graus is true, but i suggest you to use following when binding comboBox to a data source.
you have selected index change event for combo box, you can simply de attach that event before binding comboBox or what ever causes comboBox change index event to fire.
i have a combobox named "cmb1" with selectedIndexChangeded named "cmb1ChangedIndex".
simply follow this
cmb1.selectedIndexChanged -=selectedIndexChangeded;
//do binding here for both comboBox or what ever cause comboBox selectedChanged event //to fire then
cmb1.selectedIndexChanged +=selectedIndexChangeded ;
|
|
|
|
|
Right never used a flag but will research into it and also go with the bidning solution.
Many thanks for you replys
I will try the code the solution tonight ( fingers cross it works)
I will post a heads up and let you know
Thanks again
D.Arnold
dave1816
|
|
|
|
|
|
I have many applications which were working fine but ever since the DBA's re-installed SQL now some of the applications do not work. I tried everything and I could not find a solution. During SqlConnection's Open() method I get the following exception:
"Instance Failure"
Since the message is so descriptive (right!), it is hard to tell what the problem is.
I tried to connect to it by adding a new datasource to a dummy project using VS2005 and give me the same message in a message box. Now I know it is not my app but something else.
Any idea what could be causing this? It only happens with servers that have instance names and not the default.
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
Hi,
This[^] might help.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Thanks but as I said I tried everything (almost) but it did not solve my problem. I was hoping someone here have experienced the same and can help me.
I have visited all those links where your trick takes me.
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
What's the quickest way to test/check the current node when doing a loop whether that node has it's own subtree of nodes? Or rather that it just has a value.
like:
while (xr.Read())
{
//xr.checkforsubtree
If I do a:
xr.ReadElementString(); - then it advances the current node as well
I want some kind of if statement to check it before hand.
if xr.hasvalue does not work
}
|
|
|
|
|
The problem with the XmlReader class is that it can't predict the future. You can't find out if there are child nodes to the current node you just read without reading through the child nodes. If you really need this, try looking at XmlDocument instead where you read the entire XML file, then you can sift through all the nodes to get the information you want.
|
|
|
|
|
Hi.
I'm gonna create a textbox as when a user press Enter key, <br /> insert into the textbox instead of \n or \r\n
Could you guide me ?
Thanks
|
|
|
|
|
Hi,
Controls that accept keyboard input have KeyDown, KeyUp, KeyPress events. Use one or more of them to achieve your goals.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Thanks . I know them.
I don't know how I can implement it
|
|
|
|
|
They did invent a beautiful thing especially for you, it is called documentation.
If you don't know where it is, Google may show the way. Studying a book on the subject might be useful too.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
use KeyDown event, check if its Enter Key or not. If yes
TextBox.Text = TextBox.Text.Replace("\r\n", "<br />");
or
TextBox.Text = TextBox.Text.Insert(TextBox.SelectionStart, "<br />");
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Thank you Xmen W.K.
But your code doesn't work.
It inserts both of <br /> and \r\n
I've used this code, it works.
private void textBox_KeyPress(object sender, KeyPressEventArgs e)
{
TextBox textBox = sender as TextBox;
if ((int)e.KeyChar == 13)
{
try
{
e.Handled = true;
textBox.Text += "<br />";
}
catch { }
}
}
|
|
|
|
|
Well, it wasn't full code. But your code is a bit buggy What if the carret position is in the middle of text ?
Thats why use string.Insert as I posted above.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hello everyone!
I am looking for some training on a low budget. I do have several books, but was hoping that someone had some video courses they want to get rid of. I also do have a subscription to LearnVisualStudio, but some of their content is older than what I need.
Looking for:
C# (3.0 ideally)
ASP .NET 3.5 is a bonus as well.
AppDev has great training, so if anyone has their training they could sell or lend, that would be great.
|
|
|
|
|
|
These are okay and I did know about them, but they are very specific.
I am looking for content as verbose as AppDev.
I know that usually cost $$$, but I am hoping someone out there has materials they no longer use.
-Brian
|
|
|
|
|
Can anyone tell me how to open any file using its default program ?
|
|
|
|