|
Different questions - Different posts. If he wrote better subject lines it would work better. Also, if you put in all your questions into one post some people feel reluctant to answer because they don't know the answer to all the questions, or they may feel compelled to answer a post that is beyond their knowledge and give the OP some bad advice.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Please don't cross post.
Please don't spam the forum.
pankajgarg12 wrote: When, if ever, should we force the garbage collection to run?
Normally never. The garbage collection runs when needed and when there is enough unused objects for a collection to be effective. Unless you have a very extreme situation you never have to bother about it.
---
b { font-weight: normal; }
-- modified at 5:03 Wednesday 12th April, 2006
|
|
|
|
|
Everything on this forum is a problem to someone - A subject line of "problem" is absolutely useless. Please read the post at the top of the group by Chris that explains the rules of the foru,.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Why should we not use global variables??
|
|
|
|
|
Please don't cross post.
Please don't spam the forum.
pankajgarg12 wrote: Why should we not use global variables?
Because the code gets hard to follow. If you use global variables you have to know how the entire application is working to know how the global variables are used.
---
b { font-weight: normal; }
-- modified at 5:03 Wednesday 12th April, 2006
|
|
|
|
|
What is the difference b/w class and module??
|
|
|
|
|
Class is an instrument of object oriented programming.
Module is only file. wich can contain classes.
Module can contain several classes.
You'll learn more, after reading book about C# or object oriented programming.
|
|
|
|
|
Please don't cross post.
Please don't spam the forum.
---
b { font-weight: normal; }
|
|
|
|
|
Hello
I've got an idea of a ContextMenu containing special MenuItem's. I've spent the last hours with codeproject, google and a lot of coffee, but I can't find an answer. Perhaps it is very very simple and I'm just too stupid for a clear solution or otherwise it's not possible without writing a complete own implementation of a ContextMenu-class !?
ok, here you are :
I want to develop a 'customMenuItem'-class that can hold 3 or more icons/buttons (play, stop, continue) and a text entry, everything else should act as usual. I want to set a handler to each of the icons/buttons not to the text. I got no prob's with displaying my Items, but I don't found a way to set this kind of hanld or to decide on which button or Icon I've clicked (tryed with some x-positions-attributes).
ok, thanks for reading, but please do not answer with articles like 'how to build menu's with icons', they do not have different handlers for one item or don't analyse any kind of x-position inside.
thx's a lot for reading - sorry for my poor english
Mark Nüßler
|
|
|
|
|
Play, pause, continue....
You can dynamicaly uptate one item, because when one of them enabled - other items disabled, why do you want to display them all ?
|
|
|
|
|
mh,
you are right - my example with 'play, pause, continue' is not the best. just imagine some more states or actions, that do not exclude each other.
thanks for reading my question and your fast answer
|
|
|
|
|
nuessler wrote: just imagine some more states or actions, that do not exclude each other.
I think that MenuItem designed for single action.
Try using standart controls such as toolbar.
Or design "floating toolbar".
|
|
|
|
|
Hehe... Sounds like a very interesting problem...
I've done some stuff that's kinda similar, but means overriding the OnPaint method... You could always dynamically position your control according to the MouseClick event...
On_MouseClick(object sender, MouseEventArgs e){
if(e.MouseButton == MouseKeys.Right){
HoverControl control = new HoverControl();
control.Location = new Point(e.Point);
control.Show();
}
}
(Just typed that by hand... It's close, but capitalization and names might be off...)
Handle the closing of the control in the control. If you're working with a grid, you could use the object you've got in the selected row of the grid, and if no item selected, don't show the control.
Hope this helps...
F~
|
|
|
|
|
Hi,
I'm a newbie in C#! Now, I want to start my application when Windows (XP SP2) starts.
How can I do?
Thanks,
Hung
-- modified at 0:13 Wednesday 12th April, 2006
|
|
|
|
|
Add link to exe file into Windows menu "Programs\StartUp" or
add key MyProgram = "c:\MyProgram\MyProgramm.exe" into registry path "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run"
(if you need to run program once add to path "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce")
|
|
|
|
|
hello all i need help
iam zidan from egypt
and i love programming so much and i want to learn how can i start
i hear about C# and more, i want some one help me , how can i start
and thank you all
my mobile num is ( +20104893140 )
Best Regard
A.Zidan
zidan
|
|
|
|
|
hello friend,
the best way to start learning c# is through msdn, or through online
u can easily learn it (hope u know oops very well)
chakkara
|
|
|
|
|
The best way would be to get a book. And get a C# 2.0 book!
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I would recommend Professional C# By Wrox
|
|
|
|
|
|
here u have a great C# book for beginners
http://rapidshare.de/files/17794428/C__Programming_for_the_Absolute_Beginner.rar.html
|
|
|
|
|
Hello,
i am trying to keep updating a coloum for each ListViewItem in a ListView.
I though i could just do this by a thread that kept updating every 10 secound but i can see that it is only possible to update / change / work with the ListView from the Thread that originally created it.
Soo how can i achieve what i want ?
Should the thread which updates the ListView instead maybe call a method like Invoke(TheMethod) every 10 seconds, or how should it be done ?
Other Questions about Threads:
I seem to get into 2 usuall problems.
1. I only want 1 thread to be able to be created and working on a method. I usually solve this by declaring the Thread thread globally within the class, soo before i create the Thread i check if thread == null ( create thread ), and in the code which the thread is running i then set thread == null when it exit.
Is this okay ? or are there some smarter way to do it ? maybe some build in type / object or something ?
2. I only want 1 thread a time to run some code. Usually i solve this by declaring an Object threadLock globally within the class, soo i can just do lock(threadLock) { THE CODE HERE }.
Any better way of doing that ?
Best regards
Martin
|
|
|
|
|
Skoder wrote: Should the thread which updates the ListView instead maybe call a method like Invoke(TheMethod) every 10 seconds, or how should it be done ?
That's one way to do it. If all the thread does is refresh the listview, you could use the System.Windows.Forms.Timer[^] class instead.
Skoder wrote: 1. I only want 1 thread to be able to be created and working on a method.
You could use the IsAlive[^] property.
Skoder wrote: 2. I only want 1 thread a time to run some code. Usually i solve this by declaring an Object threadLock globally within the class, soo i can just do lock(threadLock) { THE CODE HERE }.
That looks fine.
Regards
Senthil
_____________________________
My Blog | My Articles | My Flickr | WinMacro
|
|
|
|
|
To do this, I tried serializing a .exe binary file into a text file then deserialize that text file into the second .exe binary file. But it does not work. Anybody have solution?
|
|
|
|
|
What's wrong with the copy function ?
Christian Graus - Microsoft MVP - C++
|
|
|
|