|
object temp = arr[7];
arr[7] = arr[5];
arr[5] = temp;
|
|
|
|
|
This is done with a regular assignment:
arr[5] = arr[7];
---
single minded; short sighted; long gone;
|
|
|
|
|
i want to check the type of all controls and execute somecode on controls on type for example heck all my form controls type and the control with the type button change it's color
ma_refay
|
|
|
|
|
foreach(Control c in Controls)
{
Button b = c as Button;
if ( b != null)
{ // It's a button
b.BackColor = Color.Red; // or whatever
}
}
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 form that contain some buttons i wnat to when click one button and then click other button the form swap button lcation together
i need the best code
ma_refay
|
|
|
|
|
Swap the Button's Location property.
|
|
|
|
|
i don't now how to tell application to sap button
for example i have 30 buttons on my form
how i told him to swap buton1 with button20
or button15 with button7
ma_refay
|
|
|
|
|
You don't swap the buttons, you simply switch places on the buttons.
Get the value of the Location property from one of the controls and store in a temporary variable. Then get the value of the Location property from the other control and put in the Location property of the first control. Lastly, you get the value from the temporary variable and put in the Location property of the second control.
---
single minded; short sighted; long gone;
|
|
|
|
|
anybody plz tell me how how to use use mouse button-up & mouse button-down for drawing in paint program as we do in microsoft paint in windows....
|
|
|
|
|
The mouse move is the event that matters. You need to keep track of the co-ordinates it moves to, and use them to draw a line in your onPaint handler. You call Invalidate() to force a Paint event.
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 am creating an application in C#
where in I require to add a toolbar.
that is no problem and that is done as well.
What I need now is that the toolbar that i insert should be a floating
toolbar
e.g. any toolbar in Office application is a floating toolbar . One
can drag them anywhere and also fix it on the top.
How do I get my toolbar to be a floating one
help me pls
Thanks
Prasad
|
|
|
|
|
How about searching in CodeProject.....
http://www.codeproject.com/cs/menu/ToolBarDock.asp
|
|
|
|
|
hi,
Thank you for u r reply
Actually I am not getting can u say me the steps to create it.
Thank YOu
Prasad
|
|
|
|
|
I am trying to create a application that when it is done updating the files that it need to it has the ability to delete itself. Is there a way of doing this, I thought that maybe if I could launch the program and run it entirely from ram that this would solve the problem.
So does anyone know how I would launch the program and run it from ram or is there a way to delete the executable when it is done?
|
|
|
|
|
Where else did you think your program is run from ? A program that is running, is in RAM, although the file is locked.
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 )
|
|
|
|
|
You may want to take a look at AppDomain.ShadowCopyFiles .
Simply speaking, with shadow copy enabled, the files holding your classes aren't locked anymore and thus can be deleted while their classes are still loaded in a running program.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
IDocHostUIHandler[^]Any idea how to solve this? Please help. Crucial
-- modified at 22:03 Wednesday 28th February, 2007
|
|
|
|
|
|
Thanks . But I think I should break my head to understand it.
286? WOWW!
|
|
|
|
|
Hello,
I am using C# dealing with DirectShow and need your help regarding this line of code. Can someone be kind enough and explain to me in plain english this line of code?
IMediaEventEx.GetEvent( out code, out p1, out p2, 0 );
My undrestanding is that the GetEvent method retrieves the next event notification from the event queue. using a txtlog I can see that the local variable "code" contains the Event Code. What I am confused about is, what I am getting on my local variables p1 and p2?
Using the txtlog I can see my p1 is series of digits. But what are they representing and do they have a particular format?
Thank you so much for your help and have a great day.
Khoramdin
|
|
|
|
|
I have a standard windows forms project for which I have created a deployment project. In the deployment project I have added a pdf file which contains the documentation for the application.
In the deployment project I have added a shortcut to the pdf documentation file to the User's Program Menu.
How do I make it so that the icon for this shortcut is the default icon for pdf files? I know that I could add an icon to the Application Folder and have the shortcut file property point to it, however the icon used to represent a pdf document can be different on different target machines. Also, I am not sure how to obtain a pdf icon.
Thanks in advance
Adam
|
|
|
|
|
I am developing a program using asp.net 2.0. I am using C# as the programming language.
In this project I am connected to a SQLServer database (SQLServer 2005). I have created a stored procedure in this database and want to call it from C#, pass it some parameters and receive from it a return value.
I am not clear as to how to call it, pass the parameters and then access the return value.
I would appreciate any help/advise/suggestions/etc on this.
Thanks, Vern
Vern
|
|
|
|
|
Use an SqlCommand object:
<br />
<br />
using System.Data;<br />
using System.Data.SqlClient;<br />
<br />
SqlConnection objConnection = null;<br />
SqlCommand objCommand = null;<br />
<br />
objConnection = new SqlConnection(YOUR_CONNECTION_STRING);<br />
<br />
objCommand = new SqlCommand();<br />
objCommand.CommandType = CommandType.StoredProcedure;<br />
objCommand.Connection = objConnection;<br />
objCommand.Connection.Open();<br />
<br />
objCommand.Parameters.Add("@MyParam", MyParamValue);<br />
<br />
objCommand.ExecuteNonQuery();<br />
<br />
if (objCommand.Connection != null)<br />
{<br />
objCommand.Connection.Close();<br />
objCommand.Connection.Dispose();<br />
}<br />
<br />
if (objCommand != null)<br />
{<br />
objCommand.Dispose();<br />
objCommand = null;<br />
}<br />
<br />
|
|
|
|
|
kryzchek:
Thanks for the code. This code and other code I got from this site was very helpful.
Thanks again, Vern
|
|
|
|
|
See using System.Data.SqlClient;
Here is some code to play with. If you are returning a query use ExecuteReader instead.
SqlConnection connection = new SqlConnection("someConnectionString");
SqlCommand command = new SqlCommand();
command.Connection = connection;
command.CommandType = System.Data.CommandType.StoredProcedure;
command.CommandText = "stored procedure name");
SqlParameter parameterCustomerId = command.CreateParameter();
parameterCustomerId.DbType = System.Data.DbType.Int64;
parameterCustomerId.Direction = System.Data.ParameterDirection.Output;
command.ExecuteNonQuery();
I feel so silly, my code doesn't work!
parameterCustomerId.ParameterName = "@customerId";
command.Parameters.Add(parameterCustomerId);
needs to be added before the execute.
File Not Found
|
|
|
|