|
hi to all,
does any body knows how can i add a check box to data grid (c# win form)
i would appreciate if someone can suggest any link, articles or samples
best regards and thanks in advance
fady
|
|
|
|
|
I don't know exactly how to do it. But I can give u some limks that can be helpful to u
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/wnf_CustDataGrid.asp
http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c44c.aspx
And the other is ASP.NET article, if u can get idea from it
http://www.datagridgirl.com/rowselector.aspx
Regards,
Sandy Sekhon
|
|
|
|
|
Hello Everybody,
Can anybody tell me how to use Enterprise Exception handling block 2.0 without using any application config files. I've seen all the exampls just using config files. Our requirement is not to use config files.
Help already appreciated.
Regards
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
Hi,
I want to dispaly the current cell number (col*row) in a text box
when the user nevigate within a datagrid.
1.how can I get the current cell ?
2.which event can I use ?
Thanks very much
|
|
|
|
|
You can use the CurrentCell property and the corresponding CurrentCellChangedEvent.
|
|
|
|
|
Hi, I am making an application that simply gets all the html from a webpage and filters out the data I want. The problem is that I want a progressbar to indicate it is working (using the "marquee" style). My code looks like this;
Private void getWebData()
{
progressBar1.Style = ProgressBarStyle.Marquee;
progressBar1.Value = 100;
//simple code to get wepage...
//simple code to filter out data I want...
//put data into listbox
progressBar1.Value = 0;
progressBar1.Style = ProgressBarStyle.Continuous;
}
I thought that this would set the progressbar going, then do the work, then stop the progress bar, but instead the progress bar just doesnt do anything, although the code to get the html data does work.
Any comment greatly appreciated,
thanks!
Martin.
|
|
|
|
|
Martin23 wrote:
I thought that this would set the progressbar going, then do the work, then stop the progress bar, but instead the progress bar just doesnt do anything, although the code to get the html data does work.
If the entire form that the progress bar is on locks up, along with the progress bar not moving (i.e. nothing is redrawn on the form), then it is probably because you are running your webpage code from the same thread. The way to get around this is to run the web code on a seperate thread (although you shouldn't update your ListBox from this new thread, as that will throw errors).
Hope that helps
Cheers,
Will H
|
|
|
|
|
Yes that does help, thnaks! Further problem now is how do I stop the progress bar? because if I put the code to stop the progress bar in the new thread, then that makes the progressbar disappears altogether when the thread finishes (why is that?), and I can't put the code like this;
Private void getWebData()
{
progressBar1.Style = ProgressBarStyle.Marquee;
progressBar1.Value = 100;
//start new thread to do everything
progressBar1.Value = 0;
progressBar1.Style = ProgressBarStyle.Continuous;
}
because then as you would expect it starts and stop the progress bar imidiately. I assume I have to somehow attach an event handler to the new thread so I know when it finishes?
thanks
Martin
|
|
|
|
|
Hmmm... Not sure. You could try an event handler, but I would take a look at this[^] article first (it explains GUI updation from different threads. I think it applies to FW v2, but I'm not sure)
Cheers,
Will H
|
|
|
|
|
Maybe you've already worked it out, but I had a play and if you stick the following code somewhere, and then call StopProgressBar() from the new thread (after all the web stuff), it should work.
private delegate void SetProgBarDelegate();
private void StopProgressBar()
{
if (this.InvokeRequired)
{
this.BeginInvoke(new SetProgBarDelegate(StopProgressBar));
return;
}
this.progressBar1.MarqueeAnimationSpeed = 0;
}
Cheers,
Will H
|
|
|
|
|
Wow, thanks Will, thats perfect!
I'll remember to pass your kindness on to someone else!
(plus I'll get a book on threading in .NET )
Martin
|
|
|
|
|
Glad I could help
Cheers,
Will H
|
|
|
|
|
I am a beginner for c# programming
in c
struct TT{
int a1;
int a2;
int a3[2][10];
}
and i can get the size of the struct by using sizof(TT), will be 88 byte
but how can i declare a struct like this in c#, and get the struct size = 88 byte;
i have try like this
struct TA{
int a1;
int a2;
public int[,] a3 = new int [2,10];
}
TA ta = new TA();
and i call Marshal.SizeOf( ta ) the size alway is only 8
how can i do ?can someone tell me why plz, and think a lot
|
|
|
|
|
Have a look at the MarshalAs attribute: MSDN[^]
---
b { font-weight: normal; }
|
|
|
|
|
thx for ur answer~~
i have already find MSDN for a while and sorry about my poor english, i can't find the answer that i want, i just want to get a struct like
struct TT
{
int a1;
int a2;
int a3[10][2];
}
in C#, and can u tell me how to write it in C# please tell me thx a lot
|
|
|
|
|
Did you look at the specific page in MSDN that I linked to?
---
b { font-weight: normal; }
|
|
|
|
|
I wanna learn about c#. I am green horn with c#. Where can I start. Please point out me.
thank in advance
|
|
|
|
|
|
thlaing wrote: I mean C#.net 2005. Thank you!
Please help me how can I start to learn C#.net. If you are not annoy with me, please help me.
thank in advance
best regards,
thanhlaing
See my previous reply - I gave a link to a very good book on getting started with C# 2005.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
Try reading stuff on MSDN.com, specifically Coding4Fun
Or try to get a book from Sams (C# in 21 days is a good starter).
But make sure you learn by doing, otherwise you will never fully understand it.
PS - there is only one version of C#, therefore it is not called C#.NET specificall as it was designed in the first place for .net
|
|
|
|
|
James Gupta wrote: PS - there is only one version of C#, therefore it is not called C#.NET specificall as it was designed in the first place for .net
Actually, if we're going to get pedantic about it the MCSD exams I took all referred to "Microsoft Visual C#.NET" (note also the capitals in .NET) Microsoft Visual C#.NET (Core Reference)[^] published by Microsoft Press is another example where the full form name is used. However, most people just shorten it to C#
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
James Gupta wrote: there is only one version of C#
To my knowledge, there are two versions of the C# compiler (and nothing stopping more being available): Mono C#[^]
Remember that C# is a set of ECMA standards[^]
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
James Gupta wrote: Try reading stuff on MSDN.com, specifically Coding4Fun
Or try to get a book from Sams (C# in 21 days is a good starter).
But make sure you learn by doing, otherwise you will never fully understand it.
Sorry if I sounded like I was being overly pedantic. I have to say that I do agree with the other stuff that you say. Especially the bit about actually "doing". It is the best way to learn as it helps firm up the ideas in the mind. Another good way is to have to explain it to someone else as it concentrates the mind. So writing articles or giving presentations can help.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
I would like to make a layer(panel or picturebox) for making some annotation on the textfield?
I try to set the backcolor to empty or transparent, i also cannot make it transparent.
Which component should i use? how i can make it become tranparent?
Thanks in advance!!
|
|
|
|
|
One suggestion and a technique that I have used before is to use another form. On that form you can remove the boarder and set the transparent key. You can also set the Opacity to give a faded look. This technique requires a little more coding to handle but is easier then using APIs. That would be the other option; for that I think will need to get a book.
|
|
|
|