|
Glad to have helped!
Chris
|
|
|
|
|
Hi
I have to display more than one button control Within a Single column of Grid control.
How can i Achieve this? can anyone help me?
thanks in advance
bye
sri
|
|
|
|
|
Hi
You can use TemplateColumn and add as many as button within the template column.
Harini
|
|
|
|
|
Hi Sri,
I have another way to do this, we can take the following steps:
1). Make a usercontrol to host buttons, the CustomButtonControl class which inherited from usercontrol.
2). Create a CustomButtonControl instance(NOTICE: we just need one), add it into the control collection of the DataGridView, initially make it invisible.
3). Handle the DataGridView.CellPainting event to draw a textbox and button style on the cell, which make the cell looked like some kind hosting a usercontrol in it.
4). Handle the DataGridView.CellBeginEdit event to show the usercontrol right in the cell while editing, you can edit in the textbox in the usercontrol and click the button, write your logic in the Click event of the button, I just show a message box for example in this sample.
5). Handle the DataGridView.CellEndEdit event to update the cell value.
6). Handle the DataGridView.Scroll event to reset the location and size of the usercontrol while scrolling. Without handling this, the usercontrol would stay still while scrolling.
Hope this will help you in moving forward in your task .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Hi,
I have an struct of BookMarkInfo ,
struct BkMarkInfo
{
public String bkMarkName;
public double X, Y, Z;
}
// Statically allocating memory for 10 objects initially
BkMarkInfo[] BkMark = new BkMarkInfo[10];
Later i need another 5 objects of same struct BkMarkInfo. How can i dynamically allocate memory for struct object?
Thanks
~Devil
|
|
|
|
|
Use List<t> instead if array
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
As Giorgi already said, use a list:
List<BkMarkInfo> BkMark = new List<BkMarkInfo>();
Use a class instead of a struct. You have made a mutable struct, which is not very practical. This, for example, doesn't work as expected:
BkMark[4].bkMarkName = "document";
When you access the struct, it will be copied into a temporary variable. The bkMarkName in the temporary variable is changed, but that won't affect the bkMarkName of the struct in the list.
Also, a struct should not be larger than 16 bytes. Yours is about twice that size.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi all,
I am using the software upgrade process within Visual Studio to perform the software upgrade. The problem is that everytime I perform an upgrade, the existing configuration file gets wiped. What must I do to prevent this?
Many thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Hi My Friends,
I write a program with C#, that after clicking button OpenFileDialog appear and you can select a text file and then my program read the text file and insert into Database.
This program work good and no problem but after click select and open text file in the OpenFileDialog about 2 or 3 second (depend to the size of file)
below picture appear :
http://www.freewebs.com/autoclinic/images/untitled.gif[^]
I want to know how can prevent this action ?
Best Regards,
Reza Shojaee
|
|
|
|
|
Your program's UI freezes because it is busy reading txt file and inserting it into database so it has no time to repaint itself. Try moving the file processing code into a new thread.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
Thanks for your guidance,
If I don't want use multithread programming.Can repaint form manually before insert data into database?
Best Regards,
Reza Shojaee
|
|
|
|
|
Try Application.DoEvents() method
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
Special thanks for you.
my problem solved.
Best Regards,
Reza Shojaee
|
|
|
|
|
Hello everyone,
1.
I have checked MSDN document,
http://msdn2.microsoft.com/en-us/library/kzy257t0(VS.80).aspx
it does not cover what is the function of WaitOne if we assign 0 as the timeout parameter.
I think the function of assigning 0 is to check whether the signal is set or not, and it will be returned immediately, right?
2.
If WaitOne (0, true) returns true, it means the signal is set or not set?
thanks in advance,
George
|
|
|
|
|
Hi
iam in windows application using c#.
my database is "FireBird Database".
Database path is :
string dsRelativePath = "database\\absolutemedia.fdb";
string dsAbsolutePath = Path.GetFullPath(dsRelativePath);
string ConnectionString = "ServerType=1;User=SYSDBA;Password=masterkey;Database=" +dsAbsolutePath;
This path is working fine upto now..
but in my application, i have an option to upload images from local drives..iam browisng an image thru "OpenFileDialog".. after selecting an image .when iam going to save ,
database path i,e dsAbsolutePath is changed to image path.it's giving error in database connection...
please reply where the problem is ?
how can i rectify this .
murali krishna
|
|
|
|
|
I think u are setting the image path in dsRelativePath after the image is selected...check that ...if so store the path in different variable
.....
|
|
|
|
|
Hi,
Thanks for Reply..
Here iam not setting ImagePath to "dsAbsolutePath";
iam taking Imagepath to another string.
murali krishna
|
|
|
|
|
i don't understand how come image path value is taken in dsAbsolutePath without setting it ...declare the dsAbsolutePath and dsRelativePath variables as constants and see if the error still occurs..can u post your code ?
.....
|
|
|
|
|
Dear all,
Can anyone help me to do bandwidth programming in C# 2003? If anyone aware of this kindly, forward me source code of sample project and also your mail id. So, I could contact you later as if I've doubt on that
|
|
|
|
|
Have you tried searching Google? There are a few articles here on CodeProject as well. Guys here don't like giving code without you doing your bit and showing what you have done. Treat Google as your friend.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Hello everyone,
1.
When we close the HTTPListenerResponse.OutputStreram (using Close method, when complete writing content from server side), I think in the internal of CLR, there should be some flush work during Close method (I do not think each time when we write to the stream, data will be flushed immediately).
But the return type of Close is void and there is no exception thrown from Close from MSDN document for Close method, if Close fail, and means data is corrupted -- flush of data failed. How could we detect this situation?
2.
Any best practices to solve the issue when program server side code?
thanks in advance,
George
|
|
|
|
|
I am working on my senior project and I am using C#.net and Microsoft Access to create a program that lets the user store information into a database. I have many tables but the primary table that mostly everything connects to is the customers table. Well I know how to insert, update and delete using C#. But I need to know how to retrieve the primary key from the customers table which happens to be an autonumber. I kind of understand that I need to use SCOPE_IDENTITY or @@IDENTITY. I just have no idea how. I have tried a couple ways without any success. The reason I need the primary key of this table is that I need it to be able to insert more data into other tables.
|
|
|
|
|
Is it necessary for you to have an autonumber field as a key in your table ? if not, u can write ur own code for auto-incrementing the id and for this, u can modify ur database and change the key field to a normal id. As far as i think auto-number fields are generated automatically when u insert the record, but u certainly can retrieve the id for viewing purpose.
|
|
|
|
|
|
Hi,
I am using streatchblt() and SetStretchBltMode() functions of unmanaged code in C# for printing image. For doing that I am calling the external gdi32.dll (form windows folder) file.
I am new in doing this sort of platform invoke operation. Plz tell me if my software is run in any windows version ranges form windows 95 to vista or any upcoming version, will this be problematic?
[System.Runtime.InteropServices.DllImportAttribute("gdi32.dll")]<br />
<br />
static extern bool StretchBlt(IntPtr hdcDest, int nXOriginDest, int nYOriginDest,int nWidthDest, int nHeightDest, IntPtr hdcSrc, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, Int32 dwRop);<br />
<br />
[System.Runtime.InteropServices.DllImportAttribute("gdi32.dll")]<br />
<br />
static extern bool SetStretchBltMode(IntPtr hdc, int iStretchMode);
>> I have tried to add this dll file as a reference in my code but failed to do so as this file is unaccessible.
Plz tell me if I have any alternative for doing the work of the above mensioned functions with managed code.
thanks in advance
Faysal
|
|
|
|