|
Sorry i have i mistake in my code ....
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
You have a lot of nerve! The first reply is correct. You are the one asking the question which means you are the one that doesn't understand. The problem is reference types vs. value types.
If you would actually read the .NET Framework SDK you might understand. And where you're most confused is that while ArrayList is a reference type, any value types (i.e. Int32 , Enum , etc.) stored in the ArrayList are still value types and store a value - not a reference, and hence changing one won't change another.
See http://msdn.microsoft.com/library/en-us/csref/html/vcrefTypesS.asp[^] for more information.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
sory previosly i had a mistake in my code where i was using an array list but some where in the code i had used clone() method so so it is my falt.
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
The problem that you are facing is nothing but, you are not instantiating the object value initially.
Simple eg:
int i;
Now is a varible. Ok. The value that is there in that i might be any garbage value( might be 0 or and number from the garbage collector). Ok.
if it is like this
int i = 0;
Now the value of i initially is 0.
I think the problem that you are facing is something of this kind.
Hope my solution is some what relevant to your problem?
See you,
Vishnu. A,
BIT,
UC.
Vish_For_You
|
|
|
|
|
dear sir ,
you did not know the problem , the problem is that when you assign any object to other one if the assigning get comes by references , any changes in any one of the variables will be change the other one becase they are the difrent reference to the same instance by the the assignment comes by value it won't happen .
so ..........
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
Hi,
I want to seperate my toolbar buttons into 3 groups, therefore I hope to make 3 individual toolbars, and they must able to dock together under menubar and floatable when Drag it out.
If I need to make own toolbar control, how to do this? And I couldn't find any good example, could some experts help me, thank you ~~!
|
|
|
|
|
i've made a simple web server, but it cannot passing data from any script or form . I wanna know how to using ISAPI extension to pass the data from client to my web server. THX!! GBU!!!
|
|
|
|
|
First, wrong forum!
Second, you're ISAPI extension has to accept appropriate data from the form. See the article http://msdn.microsoft.com/msdnmag/issues/01/10/upload/default.aspx[^] for an example. There's some links at the bottom that discuss general ISAPI programming.
While the example is for files, the idea is similar (and more simple) for plain form data. Just like a GET query string that passes a key/value pairs separated by & and associated with =, POST query data is delimited in the same way but uses the content-type "multipart/form-data".
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Linking database with C# was easy but the problem that I faced when I was working on my project was when the database and the program was is in local drive(C) and working, then I cut that and put it in my network folder.
After that when I again copy that and put it in c drive and run it, then the links are changed and again I had to put all the links again. That is a rediculous task.
Can any one provide solution for this?
Vish_For_You
|
|
|
|
|
Links? You mean connection strings and what-not? Put the connection string in your application configuration file (yourappname.exe.config) using the <appSettings> section (see the documentation for that element for more information) and use the System.Configuration.ConfigurationSettings.AppSettings to get it out. This is pretty much the common practice for both Windows and Web Forms.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
That sounds helpful.
Thank you I will try that one and reply you.
Bye,
Vishnu. A,
BIT,
UC.
|
|
|
|
|
You know... some full screen windows program have those menu bar on top? if you press ESC it will hide and you press ESC again it will Unhide? I like that kinda style but then... I'm a super C#/programming n00b, I only started C# for like a week, I don't know syntax and everything, it would be cool if anyone can show me exact what I should do (I only know the part about adding the menu to the application form by double click the MainMenu in the ToolBox), to add code to make the menu hide and unhide with ESC key, I dunno that one =^^=
please help a n00b
http://www.hentaitheme.com
Free Public Ragnarok Online Game Server
|
|
|
|
|
Look at the KeyDown event. There are other events that work similar, but this (or KeyUp ) is the easiest since you're passed the KeyCode that was pressed.
As far as how to do it, well, you're going to have to learn. In VS.NET, you can switch to the events tab in the Property Grid, find one of those events I mentioned and double-click it for a default name. Start reading the documentation for the KeyEventArgs that is passed and you'll even find some good examples.
Blindly fumbling through code and relying soly on IntelliSense won't teach you anything. Researching most definitely will and is required for good development skills. If you still can't figure it out, post to the forum what exactly is wrong (compile errors, exceptions thrown, etc.) but try to figure it out first. It's the only way to truly learn especially when you're a n00b.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Your post didn't help at all since I'm a n00b and there are too many topics about KeyEventArgs in the MSDN and there's no example that I was looking for.
http://www.hentaitheme.com
Free Public Ragnarok Online Game Server
|
|
|
|
|
Well, there's only one way to learn, bubba. Start reading the topics in MSDN and start-off basic if you can't understand the "advanced" (even though it's not) stuff. Making guesses and asking others for complete examples won't teach you anything.
Here's a (rather thorough) tip, though: handle the KeyDown event and in the KeyEventArgs check if the KeyEventArgs.KeyCode property is set to KeyCode.Escape . Then either call Show or Hide on the Form . The only problem is that once the form is hidden, it won't receive keyboard events because it doesn't have the focus. So, you'll have to have another Window that is capable of showing the window again if the [ESC] key is pressed again.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
wha?? that's bullshit and so much trouble, I saw other programs made in C++, it doesn't look so hard and hassle, I start off with C# because I thought it's easier than C++, now I think C# is bullshit, so little examples to learn from and people aren't even helpful, there are tons of examples with C++ about that hide/show menu but I wanted it in C# but no examples....
http://www.hentaitheme.com
Free Public Ragnarok Online Game Server
|
|
|
|
|
Look, a window can't receive input if it doesn't have the focus! Period. If can't have the focus if it isn't visible! Period. If you don't believe me, read the damn Windows Manager section in the Platform SDK. The only other way is to install a hook and remove it when visible again.
And it's so much trouble to actually READ the documentation? Right. You'll learn a lot that way.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I currently have a collection of custom business objects which is a datasource for my DataGrid. I would like a property of this custom object to be an image which is displayed in the datagrid. I am using column styles and DataGridTextBoxColumns for all other properties. How do I display an image?
I need the solution to be generic, so I can't be using delegates or other solutions that require a hardcoded function for a particular image.
I have not found anywhere on the net that describes how this can be done. Does anyone have any sugguestions?
Please help.
Thanks.
|
|
|
|
|
I’m pretty sure that you'll find all that you need about DataGrid at
Windows Forms FAQ:
http://www.syncfusion.com/FAQ/Winforms/
Best Regards,
Daniel Zaharia
|
|
|
|
|
I think this is a valid solution. Any Sugguestions?
I have created a class called GridIconOnlyColumn which implements DataGridTextBoxColumn
protected override void Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.CurrencyManager source, int rowNum, System.Drawing.Brush backBrush, System.Drawing.Brush foreBrush, bool alignToRight)
{
try
{
g.FillRectangle(backBrush, bounds);
if (mobjGrid == null)
{
mobjGrid = (Prud.Controls.Grid)this.TextBox.Parent;
}
// Get Custom Object
object objRow = mobjGrid.Rows[rowNum];
//Draw Image
g.DrawImage((System.Drawing.Image)PropertyDescriptor.GetValue(objRow), bounds);
}
catch (Exception err)
{
throw err;
}
}
|
|
|
|
|
Assume my windows based program is named 'App1'.
How can I write
If App1 == Already running
{
then exit and do not run a second instance
}
thanks
|
|
|
|
|
using System.Diagnostics;
In the Main function for your app...
Process proc = Process.GetCurrentProcess();
Process[] procs = Process.GetProcessesByName(proc.ProcessName);
if (procs.Length > 1)
Application.Exit();
else
Application.Run(new Form1());
|
|
|
|
|
|
Jeff,
Shouldn't that read:
if (procs.Length > 0)
Thanks,
Alvaro
He who laughs last, thinks slowest.
|
|
|
|
|
No. The first instance of the program would never run because the Process array includes the current running process. So changing it to Length > 0 would cause the program to never run.
|
|
|
|