Click here to Skip to main content
16,005,162 members
Home / Discussions / C#
   

C#

 
GeneralRe: Form Question Pin
Guffa18-Oct-07 13:56
Guffa18-Oct-07 13:56 
AnswerRe: Form Question Pin
MasterSharp18-Oct-07 10:36
MasterSharp18-Oct-07 10:36 
AnswerRe: Form Question Pin
Nouman Bhatti18-Oct-07 22:15
Nouman Bhatti18-Oct-07 22:15 
AnswerRe: Form Question Pin
MasterSharp19-Oct-07 3:21
MasterSharp19-Oct-07 3:21 
QuestionI can't make Debugger.Log() work Pin
werpa18-Oct-07 7:11
werpa18-Oct-07 7:11 
AnswerRe: I can't make Debugger.Log() work Pin
TJoe18-Oct-07 7:57
TJoe18-Oct-07 7:57 
GeneralRe: I can't make Debugger.Log() work Pin
werpa18-Oct-07 8:05
werpa18-Oct-07 8:05 
QuestionForm display isn't refreshing Pin
gizmokaka18-Oct-07 7:04
gizmokaka18-Oct-07 7:04 
Hello to all.
I have a function that according to some criteria creates zedGraph curves for display in a graph.
the function is as follows(cut):

private void createCurves(ZedGraphControl zgc)
        {
            ColorSymbolRotator rotator = new ColorSymbolRotator();
            #region create curves as needed
            for (int i = 0; i < lgControlsPanel.Controls.Count; i++)
            {
                if (lgControlsPanel.Controls[i] == angleCheckBox)
                    if (angleCheckBox.Checked)
                    {
                        foreach (string key in valveCheckedListBox.Items)
                        {
                            if (valveCheckedListBox.CheckedItems.Contains(key))
                            {
                                zgc.GraphPane.AddCurve(key + ": Angle", anglePointArr[HexToLong(key)], rotator.NextColor, rotator.NextSymbol);
                            }
                        }
                    }
.
.
.
            zgc.AxisChange();
        }


The problem I encounter is that if I call this function from the main thread that craeted the form
on which the zedGraphControl is placed, everything is going fine.
BUT, if I let a new thread handle it, it does all operations fully but isn't refreshing the graph
view until I live the form and return to it.
only then do I see the changes.

here is my new thread call:
<br />
Thread startCreateCureves = new Thread(delegate() { createCurves(zgc); });<br />
startCreateCureves.Start();


of course I tried already to use invoke method and refresh with no luck:

private void createCurves(ZedGraphControl zgc)
        {
            if (zgc.InvokeRequired)
            {
                createCurvesHandler d = new createCurvesHandler(createCurves);
                this.Invoke(d, new object[] { zgc });
            }
            ColorSymbolRotator rotator = new ColorSymbolRotator();
            #region create curves as needed
            for (int i = 0; i < lgControlsPanel.Controls.Count; i++)
            {


I also tried it with: this.Invoke(), and NADA.

can someone please explain to me the weird phenomenon?

thanks in advanced.
AnswerRe: Form display isn't refreshing Pin
Luc Pattyn18-Oct-07 7:35
sitebuilderLuc Pattyn18-Oct-07 7:35 
GeneralRe: Form display isn't refreshing Pin
gizmokaka18-Oct-07 12:54
gizmokaka18-Oct-07 12:54 
GeneralRe: Form display isn't refreshing Pin
Luc Pattyn18-Oct-07 12:58
sitebuilderLuc Pattyn18-Oct-07 12:58 
GeneralRe: Form display isn't refreshing Pin
gizmokaka18-Oct-07 13:03
gizmokaka18-Oct-07 13:03 
GeneralRe: Form display isn't refreshing Pin
Luc Pattyn18-Oct-07 13:16
sitebuilderLuc Pattyn18-Oct-07 13:16 
AnswerRe: Form display isn't refreshing Pin
Patrick Etc.18-Oct-07 8:20
Patrick Etc.18-Oct-07 8:20 
GeneralRe: Form display isn't refreshing Pin
gizmokaka18-Oct-07 13:01
gizmokaka18-Oct-07 13:01 
GeneralRe: Form display isn't refreshing Pin
gizmokaka18-Oct-07 13:04
gizmokaka18-Oct-07 13:04 
GeneralRe: Form display isn't refreshing Pin
Patrick Etc.18-Oct-07 14:14
Patrick Etc.18-Oct-07 14:14 
QuestionAdd/Remove Network Protocols Pin
Harkamal Singh18-Oct-07 7:03
Harkamal Singh18-Oct-07 7:03 
AnswerRe: Add/Remove Network Protocols Pin
kingletas18-Oct-07 7:27
kingletas18-Oct-07 7:27 
GeneralRe: Add/Remove Network Protocols Pin
Harkamal Singh18-Oct-07 23:42
Harkamal Singh18-Oct-07 23:42 
AnswerRe: Add/Remove Network Protocols Pin
kingletas19-Oct-07 5:31
kingletas19-Oct-07 5:31 
QuestionBind data into textbox Pin
zafax_18-Oct-07 6:47
zafax_18-Oct-07 6:47 
AnswerRe: Bind data into textbox Pin
zafax_18-Oct-07 6:54
zafax_18-Oct-07 6:54 
Question3G/GPRS Connection [modified] Pin
Eurfyl18-Oct-07 5:52
Eurfyl18-Oct-07 5:52 
AnswerRe: 3G/GPRS Connection Pin
led mike18-Oct-07 6:30
led mike18-Oct-07 6:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.