|
i am biggner in c#.
i want to how to get multiple value from listbox or dropdownlistbox.
|
|
|
|
|
Take a look at the SelectedItems property.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
sir,
i try with selecteditem property,but i dont get success.
|
|
|
|
|
Ajeet mittal wrote: i try with selecteditem property
So use the SelectedItems (emphasis on the plural) property as I said.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
and dont forget to set ListBox.SelectionMode to an appropriate value.
|
|
|
|
|
Hello All,
I am developing a shopping cart and both registered users and anonymous users can shop. The problem iam facing is with anonymous user how to create a visitorId so that i can link them to shopping cart. Visitor ID should be unique ie for every user, do i use session for this. Any suggestions guys.
Best Regards, Shilpa.
Thanks in Advance for your help. Best Regards
|
|
|
|
|
Hi,
You can use the SessionID property of the session. it's unique.
You can also create your own ID (a guid for example) and store it in the session object :
Guid VisitorID = Guid.NewGuid();
Session["VisitorId"] = VisitorID;
|
|
|
|
|
Hello everyone,
I have realised that there are Visual differences between the Button images. Some of them are square and look like the old fashion Windows Application and some like Windows XP.
It seems whenever the code is written in Visual Studio 7 once they are opened in Visual Studio 8 even after the converstion is successful, the button image looks like the old windows 3.1.
Here is an example for the square old windows style:
http://www.codeproject.com/listctrl/listview.asp[^]
Here is an example to show the rounded Button Windows XP look alike is this example:
http://csharp.simpleserial.com/[^]
What I find strange is that if I start a new project in Visual Studio 8 it creates Button shown in example Two but if I build on a project which was initially created in Visual Studio 7 then all the buttons look squared and old style including the Buttons which were added to the application in Visual Studio 8.
I have checked the Button Propeties and they are identical!!! Can someone tell me how we can change the Button Shown in example one into the one shown in example two?
Thank you so much for your help and have a great day.
Khoramdin
-- modified at 22:11 Thursday 1st March, 2007
|
|
|
|
|
Hi,
the esthetic improvement in some controls is called "VisualStyles"; you must enable
it explicitly to get it, and it needs/uses a more recent version of one of the
system's dll files.
There are different ways to enable VisualStyles, one of them is calling
Application.EnableVisualStyles() before Application.Run().
But is exists only since .NET 2.0
For more info please search CodeProject for VisualStyles, or read the documentation.
|
|
|
|
|
how to import multiple dll files in c#.
|
|
|
|
|
Hi
??
for N dll files, repeat N times what you do to import one dll !?
|
|
|
|
|
Hi ı need MCTS Self-Paced Training Kit (Exam 70-536) ebooks , ı don't know find it please help me
kaan06tr@gmail.com
Kaan
|
|
|
|
|
just buy the books already, ebooks are usually pirated.
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 )
|
|
|
|
|
Hi All:
I am trying to draw small points ontop of an origin background. I am trying to plot points in a 4 coordinate background. So I want the background to be stationary and the points to change given the incoming values. How can I do this? Right now my background is redrawing everytime I draw the small square so it looks awful! Please help!
Laura
|
|
|
|
|
You need to turn on double buffering, probably. Sorry, you need to google for the code, don't know it off hand.
You also need to post your code, so we can see how you're going about it.
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 )
|
|
|
|
|
I have a slight bug in one of my programs. It is a program that involves databinding with ADO.NET 2.0. My main form is bound to one of the tables. I have another form and a combo-boxon my main form that is bound to the other table (there are only two) in the database. When I run the application, I find that the individual forms work correctly, but the combo-box does not update if I add a new field in the other form unless I restart the application after closing it. I need a way to refresh that combo-box! Please help!
Person ejbing = new Person();
ej.SayGoodbye();
|
|
|
|
|
I believe the correct form is to do another fill in your main form after returning.
dataAdapter.Fill(dataSet, [table]);
Hope this helps
Started out with nothing and still have most of it left!
|
|
|
|
|
Thanks! I'll have to give it a whirr. You said:
dataAdapter.Fill(dataSet, [table]);
Person ejbing = new Person();
ej.SayGoodbye();
|
|
|
|
|
Hi all I am new to C# and real new to drawing with it. I have been looking online and have been unsuccessful in finding tutorials or examples in what I am trying to do. I am trying to draw a very small square about 1cm in size. I want to draw it at a certain location on the form. Does anyone know how to do this or can help point me in the right direction with sample code. I have a timer implemented and when the timer interrupt occurs I want to draw the small square in a differnt location in the form. Right now its not drawing anything. I call my paint function in the timer event function by doing the following:
this.Paint += new PaintEventHandler(XYZ_Paint);
But nothing gets displayed to the form, not even a simple line or anything. Why is this? Please help. I am using C# and Visual Studio 2005.
Thanks,
Laura
|
|
|
|
|
Your timer function needs to call Invalidate(), this will force the paint event to occur.
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 so much! That worked. Now how can I dry a small square and display it in the form at certain locations?
|
|
|
|
|
Add your painting commands to your paint handler (you called it XYZ_Paint).
Just get the Graphics from the PaintEventArgs, and use DrawLine, FillRectangle and all
the other nice Graphics methods.
For animation, use coordinate variables that get changed by your timer tick handler.
|
|
|
|
|
Could you give me a coded example of drawing a 1cm square or a point whichever is easier on a form at location (15,25)? Thanks so much!
|
|
|
|
|
It's just e.Graphics.FillRectange(15, 25, 20, 20); assuming that 20 pixels is about 1 cm.
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 )
|
|
|
|
|
Hi,
in the form's paint handler I would do:
Graphics g=e.Graphics;
g.DrawRectangle(Pens.Black, 15, 25, w, h);
now what are the right values for w and h ?
for a point (or a very small square), set them both to 1 or 2.
for an exact size, it is complex:
- first you must assume that your system settings are correct, i.e. the right dpi
have been set (by default a monitor gets installed at 96 dpi, which is less than what
the average modern monitor is showing). You can change them to the correct value by first
calculating the value, then setting it interactively under Display Properties/Settings/
Advanced/DPI Settings: select custom settings, and then enter the number as a
percentage of 96 dpi.
remark: everything will look smaller now (except for the desktop, which now can hold
much more stuff); you may want to increase the system's default font size, icon size,
etc.
- then your program should find out what the system's dpi settings are, by calling
something like
Bitmap bitmap=new Bitmap(100, 100);
Graphics gBM=Graphics.FromImage(bitmap);
int Dpi=gBM.DpiX;
gBM.Dispose();
This has to be done only once in a program (unless you want to cope with a change
in the setting while the program is running...)
you dont have to worry about DpiY, it will equal DpiX (you could only enter an
overall dpi value in the previous step, so best is to calculate it diagonally !)
Now you can calculate how many pixels are needed to travel 1 cm, and that's the
right value for w and h.
remark: if your system settings are incorrect, dont bother calling gBM.DpiX, since
everything would be based on a lie, hence wrong.
|
|
|
|