|
In C# WinForm use the event SelectedIndexChanged from ComboBox :
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
textBox1.Text = comboBox1.Text;
}
But in ASP, ask in ASP.NET forum.
|
|
|
|
|
I wrote this below code but nothing is working.
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
TextBox1.Text = DropDownList1.Text;
}
|
|
|
|
|
above code i hav written in default.aspx.cs file
|
|
|
|
|
Have you ever used event handler ??
Do this first ...
comboBox1.SelectedIndexChanged += comboBox1_SelectedIndexChanged;
|
|
|
|
|
Hey thanks ...........
I solved my problem.
Nice site, and nice members too.
Once again Thanks
|
|
|
|
|
Yes, but did you hook into the event? Or just write the handler?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Hi,
Please help me who know these answer:
I need to Know the which cultureinfo is used in system.
For example: I need to know my system has which datetime format is used us or uk. To know the datetime format of US or UK. Can any idea in Localization or Globalization
Thanx in advance
|
|
|
|
|
Clickity[^]
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Application.CurrentCulture
|
|
|
|
|
hi everyone...i have a basic knowledge of asp.net using vb.net and am working now on a project that use c# classes i get to code where i see someting like this Dictionary<string, PageConfig>...so whats that mean
please allow me to be a good programer
|
|
|
|
|
|
thank you
please allow me to be a good programer
|
|
|
|
|
I've been working on a CRS system, and was running into a nasty error...
For some reason every ~16 or so search queries, the program would crash, and give me a WIN32 exception, telling me that my program had used up all its allocated handles.
Ok, so I wasn't disposing of my objects correctly somewhere...
After much searching, I found that the foreach loop that was disposing of the results was not working as expected. (the search results were displayed using Panels).
If I called:
<br />
int i = window.FlowPanel.Controls.Count;<br />
It would return the expected number of (say) 20.
However when I ran:
<br />
foreach (Control c in window.FlowPanel.Controls)<br />
{<br />
c.Dispose();<br />
}<br />
It would cut out of the foreach loop at the 10th object.
If I ran the same foreach loop directly afterwards, it would cut out at the 5th object etc etc.
I solved the problem by using this snippet:
<br />
while (window.FlowPanel.Controls.Count > 0)<br />
{<br />
foreach (Control c in window.FlowPanel.Controls)<br />
{<br />
c.Dispose();<br />
}<br />
}<br />
<br />
GC.Collect();<br />
This solved the problem, but can anyone explain this behaviour?
Cheers,
Mark.
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
|
|
|
|
|
It's not that unexplained - Think of it this way: If you have a list and you iterate through it, what happens when you delete one of the list entries? What is the next entry for an entry which has been deleted? What happens when the Controls list is traversed by a different process?
Since foreach does effectively that - calls Controls.Next each time round the loop - it is very understandable that at some point you will have a problem. Normally, you would get a "Collection was modified; enumeration operation may not execute" exception, but I guess Dispose doesn't check that!
Use Controls.Remove to take the controls out of the list, then Dispose them. You will need to need to modify the foreach to a for loop (and I suggest iterating backwards from the last to the first, to make it safer.) You will probably find you can rely on the frame work to do the dispose this way.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Damnit, beat me to the punch.
var question = (_2b || !(_2b));
|
|
|
|
|
Thanks!
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
|
|
|
|
|
You're changing the collection you're iterating through--
So the object you started off with at the beginning of the loop is not the same one at the end.
I'm surprised it even let you do that...
a
for(int x=FlowPanel.Controls.Count-1; x>=0; x--)
{
FlowPanel.Controls(x).Dispose();
}
should do the trick, I think.
var question = (_2b || !(_2b));
|
|
|
|
|
Sorry about beating you to it - it was just luck - but I still think using Remove from the controls list will be a better solution than Dispose!
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
OriginalGriff wrote: Remove from the controls list will be a better solution than Dispose!
Agreed, no arguments there. Didn't think it through completely ;>
var question = (_2b || !(_2b));
|
|
|
|
|
Thanks!
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
|
|
|
|
|
hello friends!!
I have made a library for my c# project by combining 3 libraries (using ilmerge).
I wanted to know, is it possible for someone to decompile my new library or view the code?
if yes, how do i protect it?
or is there any other way of merging the library with my project?
|
|
|
|
|
Use Reflector[^] to see the result.
Normally a dll can be protected by Obfuscation.Dotfuscator is a Visual Studio Tool using for obfuscation.
|
|
|
|
|
dotfuscator is good but it does not encrypt the code.
also the project shows an error after being linked with the obfuscated library. obviously because it cannot import the namespaces. how do i correct this? do i need to merge my dll with exe?
|
|
|
|
|
I think you are using dotfuscator in the Visual studio project Dlls.Instead of that use it for dll's and exe in the BIN folder.ie,in the output directory not in the Visual Studio project.
While using dotfuscator browse all of your dlls and also your exe from your build output directory.Otherwise this dll won't work with that exe because of the change in method names and private variable names.
|
|
|
|
|
Thanks arun,
I was only importing dll and not the exe
Now i get the problem.
Thanks again.
|
|
|
|