|
|
Are you sure? What does the error message look like?
---
b { font-weight: normal; }
|
|
|
|
|
guffa thanks for help but ive found it i hadnt put a full stop in xlapp visible true.
|
|
|
|
|
|
Michael yes have tried that no joy
|
|
|
|
|
|
Hi,
In one windows form i.e. form1 I have a public variable (i.e. variable1) where it gets set to "hello"
in the other form i.e. form2 , I would like to get the value of the variable1 in form1 (i.e. form1.variable1)
how is this done please?
Thanks
|
|
|
|
|
First, don't make fields (what you call a public variable) public. They should never be exposed outside the class or its derivatives. If you do that you shoot a very large hole through the concept of encapsulation. Here are some more reasons why you should make fields private and not public[^]
Secondly, and to answer your questions: Here is an article on passing values between forms in .NET[^]. It will show you good techniques to do this.
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
|
|
|
|
|
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
|
|
|
|