|
put a breakpoint inside the event handler and then view the call stack when the breakpoint gets hit. that should help you figure out how it's getting called.
|
|
|
|
|
What might be happening is that if the radioButtons are in a group (all in the same control will do for that), one of them should be checked. They are option selectors, so, one option should be true.
The solution for this depends on what you are using them for, but one way is to add an extra radioButton labelled 'None' and set that to checked.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi,
how about this:
first your Form_Load handler gets executed on the GUI thread; it fires three Button_Changed events, which sit in the event queue since the GUI thread is still busy loading your form. When that is done, and well after you have set isLoading true again, the three Button_Changed handlers get executed by the GUI thread, and they do what you don't want to be done...
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Thank you all for the wonderful suggestions. I will try your suggestions to see what might be causing it.
CodingYoshi
Visual Basic is for basic people, C# is for sharp people. Farid Tarin '07
|
|
|
|
|
Hi , Have a good day ...
I have a little problem in my router simulation program
here is an explaining for it :
suppose I have 5 pionts : pt 1 , pt 2 , pt 3 , pt 4 , pt 5
--------------------------------
pt 1 is connected to pt 2
pt 1 is also connected to pt3
pt 2 is connected to pt 4
pt 4 is connected to pt 5
--------------------------------
so it's very clear that there are two points btween pt 1 , pt 5
pt 1 --- > pt 2 ----> pt 4 ------> pt 5 ...
How I can figure that out in my application ?
I don't need you to write for me a code ( I will glade if you did )
but may be you can help .. in an algorthim , or something like that ...
or provide me with hint ..
and many thank in advance ?
----
P.S
is this is the right place for my Question ?
may be you can tell me where should I ask , such a Question ..
Kind regards
I know nothing , I know nothing ...
|
|
|
|
|
Try googling for "shortest path algorithm".
You might have got more help in the 'Algorithms' Forum.
However, if you do as suggested above and then get stuck in a particular place whilst trying one of the hits out, so long as you are using C#, this would be the right place.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Well, if the points are just a few, I would go with brute force algo.
BTW the right place to post such a question is the Algorithms forum [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: the right place to post ...
CPallini wrote: I would go with brute force algo
we don't need a separate forum for your brute force advise, do we?
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Yes, we need the SoapBoxe...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Henry Minute ,thank you very much I googled Shortest path Algorithm ( thats is the word I was looking for )and I find many useful things .. I think I need sometime to read and understand them ... thank you so much
CPallini , thank you very much for the BruteForce solution it's really a brilliant Idea
if I can't solve this problem in the hint you gave me , I will post my Question
in the algorithm forum ,thank you so much
Kind regards ...
I know nothing , I know nothing ...
|
|
|
|
|
Hello all,
regarding tracing everywhere i am coming across this statement:
"in order to enable tracing, the /d:TRACE flag must be passed into the C# compiler or the /d:TRACE=True flag must be passed into the VB compiler."
I added few trace statements (Trace.writeline..) in my project and compiled solution in "Release" mode without any compiler trace flags and my trace statements are working fine, which means trace statements are being logged.
What is the significance of "/d:TRACE" compiler flag?
Thanks.
|
|
|
|
|
I suppose you compile in Visual Studio. Just look at the output window after you compile you project. Visual Studio is adding this flag automatically for you. Search for /define:TRACE
Vitaliy Tsvayer
Tikle
|
|
|
|
|
I see... thanks for the clarification. So, if we build our solution from command line (say using msbuild...) we should add this flag, right?
Thanks.
|
|
|
|
|
Yes, you will have to add this flag and possibly some more while using c# compiler from command line.
Vitaliy Tsvayer
Tikle
|
|
|
|
|
If you double-click the 'Properties' folder for a project in the Solution Explorer, then click on the Build tab, you will see two checkboxes:
'Define DEBUG constant', and 'Define TRACE constant'. If the TRACE one is checked, VS does it all for you, if unchecked, you get no trace.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
this is my first C# project so bear with me. Here is the code. HistoryDataView is part of Form1 and is set to public.
namespace LockOut
{
public partial class Utility : Form
{
public Form1 m_parent;
public Utility(Form1 frm1)
{
m_parent = frm1;
}
public static DataTable DeviceHistory()
{
OleDbConnection pcDataConn = DBConnection();
try
{
DataSet ds = new DataSet();
string SQL = "SQL Statement";
OleDbDataAdapter adapter = new OleDbDataAdapter();
adapter.SelectCommand = new OleDbCommand(SQL, pcDataConn);
adapter.Fill(ds);
DataTable dt = new DataTable();
dt = ds.Tables[0];
if (dt.Rows.Count < 1)
{
dt = null;
}
pcDataConn.Close();
return dt;
}
catch(Exception ex)
{
pcDataConn.Close();
DataTable dt = null;
Console.WriteLine(ex.Message.ToString());
return dt;
}
}
public static void UpdateDeviceHistory()
{
m_parent.HistoryDataView.DataSource = DeviceHistory();
}
}
------------------------------------------------------
namespace LockOut
{
public partial class Form1 : Form
{
private void Refresh_Click(object sender, EventArgs e)
{
Utility.UpdateDeviceHistory();
}
}
}
|
|
|
|
|
Any reason the Utility class is a form? I would make Utility a regular class and remove the UpdateDeviceHistory method. Then in Form1 i would do this:
HistoryDataView.DataSource = Utility.DeviceHistory();
|
|
|
|
|
That is actually how I had it running initially within Form1. But I have another method within the Utility Class That logs the transactions and I wanted to be able to just update the datagridview after every log, so I would still need to use it from this class. I just turned it into a button click for testing. I hope this makes sense.
|
|
|
|
|
Not a very good idea to do that. But if thats what you want to do, you would have to make the m_parent static.
|
|
|
|
|
Why does Utility inherit from Form ? If it really is a 'Utility' class, does it need to inherit from Form ?
In order to give the most appropriate answer, it would help to know this.
In general the problem is that your methods are class methods (static), but your fields are not. Non-static items can only be accessed through an instance of a class, not through the class itself.
[Mod]
It took me so long to type this that your question has already been answered.
[/Mod]
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Your UpdateDeviceHistory method is static. But you are trying to access m_parent. You can't do that. Because m_parent is not static. To be more specific context of your program is needed but you could do this at least:
1. Remove static from your UpdateDeviceHistory method.
2. create Utility class instance and call UpdateDeviceHistory on that instance, that is:
Utility utility = new Utility(some_form_with_HistoryDataView)
utility.UpdateDeviceHistory()
Good Luck
Vitaliy Tsvayer
Tikle
|
|
|
|
|
hello guys!
i'm having some issue figuring out what to use for my application.i'm developing a desktop application pulling most of its data from websevices.I display the data which can be huge with a datagrid.
i have a webservice datasource and bind that datasource to the grid.
Now i want to give better user experience and feedback to users.The method i found online for the backgroundworker with the progressbar is not satisfactory enough.Actually they use loops to give the reportprogress the percentage to show while in my implementation i can't put webservice calling into a loop.I'll like to use the webservice async call with the progress bar but then i don't know how to update the progress bar to display the appropiate percentage.So if anybody can point me to a ressource or a workarround i'll be more than glad.I 'm open to suggestion so please let me know what you think.
Thanks for reading this.
eager to learn
|
|
|
|
|
Well it depends on whether you have one web service call through which you get all your data or you have multiple separate web service calls to get your data. In the first case it won't be easy to update progress as web service needs to get the whole XML data before it can be parsed etc etc. It can be asynchronous but without progress updates. In second case BackgroundWorker is really suitable here. You do not need any loops as it is shown here http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx[^]. You simply call ReportProgress() method to update current progress between your web service calls and handle ProgressChanged events to update progress bar. Hope this helps somehow.
Vitaliy Tsvayer
Tikle
|
|
|
|
|
Thanks vitaliy.Your suggestion helps but for some reason the progress bar is not updated at all since i have only one web service per form.Thank any way.
eager to learn
|
|
|
|
|