|
Well yes, that's what Expression Blend does. It'll probably be cheaper to buy it than putting in vast amounts of time and trouble to create something similar.
Standards are great! Everybody should have one!
|
|
|
|
|
Expression Blend would work but we are looking to create a custom one that we can develop and deploy so that anyone can create a custom application simply by dragging controls onto a design surface
|
|
|
|
|
Hi,
I've created a timer object with these statements
private Timer stepTimer = new Timer();
stepTimer.Interval = 1000;
stepTimer.Tick += new EventHandler(stepTimer_Tick);
these statements are in my constructor.
when I call stepTimer.Start(); in the constructor it comes to the stepTimer_Tick method.
However, when I do that somewhere else (for example I am trying to call in another callback function)
it does not enter the function stepTimer_Tick.
I've taken the statement (stepTimer.Start(); ) to different locations but it is still the same. How can I solve that.
Thanks...
aysan ethem narman
|
|
|
|
|
Hello,
As you are using the Forms.Timer which is running in the UI thread, you have to be carefull when accessing it from an other thread.
In this case you have to invoke the method which calls the Timer like this.
private delegate void EnableTimerDelegate();
private void EnableTimer()
{
if(InvokeRequired)
{
Invoke(new EnableTimerDelegate(EnableTimer), new object[] {});
return;
}
if(!stepTimer.Enabled)
{
stepTimer.Enabled = true;
}
}
Invoke and InvokeRequired are members of Control.
Hope it helps!
All the best,
Martin
|
|
|
|
|
Hi,
Thank you very much it works.
Interesting thing is I've met cross thread operation many times before, I've caught them with try catch blocks and solved with invoke method as you did. However, this time it did not fire any exception although it is again in a try-catch block. So I did not doubt about this problem.
Again thank you...
aysan ethem narman
|
|
|
|
|
Hello,
alashara wrote: Thank you very much it works.
Glad I could help!
You are wellcome!
-- modified at 5:53 Thursday 12th July, 2007
I assume that you now don't work with this dirty try/catch blocks and use the InvokeRequired instead, at least I would suggest it!
P.S.: It's allways nice to read a "Thank you", like you did! Got my '5' for that!
All the best,
Martin
|
|
|
|
|
Hi,
to which try-catch block should an InvalidOperationException (the one that
fires on cross-thread sins) report when it occurs in a callback method
(i.e. one that does not include its own try-catch) ?
It just gets swallowed. There are a couple of situations where an Exception
seems to disappear, you wont notice unless you look very carefully...
UnhandledException got added in .NET 2.0 to improve on the situation.
|
|
|
|
|
Hi all,
Does anyone know how to change the computers short date format that is listed in the control panel (Regional and Language Options).
If anyone is thinking go into the control panel and change it... no... -.-;
I need to do it programmically!.
Cheers,
Mark
|
|
|
|
|
Haven't used that befor, but "kernel32.dll" provides a lot of usefull methods in this topic.
Like:
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public struct SystemTime
{
public short sYear;
public short sMonth;
public short sDayOfWeek;
public short sDay;
public short sHour;
public short sMinute;
public short sSecond;
public short sMilliSeconds;
}
[System.Runtime.InteropServices.DllImport("kernel32.dll")]
public static extern bool SetLocalTime(ref SystemTime time);
[System.Runtime.InteropServices.DllImport("kernel32.dll")]
public static extern bool GetLocalTime(ref SystemTime time);
Or:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TimeZoneInformation
{
public int bias;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public string standardName;
SystemTime standardDate;
public int standardBias;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public string daylightName;
SystemTime daylightDate;
public int daylightBias;
}
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
private static extern bool SetTimeZoneInformation([In] ref TimeZoneInformation lpTimeZoneInformation);
[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
private static extern int GetTimeZoneInformation(out TimeZoneInformation lpTimeZoneInformation);
Maybe you are luky with kernel32?
All the best,
Martin
|
|
|
|
|
how we can access "protected internal" class?
vamsi
|
|
|
|
|
Sounds that this question is asked in the Interview?
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
Well there are a number of access qualifiers: private , protected , internal , and public .
protected means that only the class and anything derived from it has access.
internal means that only code in the same assembly has access.
Now, protected internal is a combination (union) of the two.
See here instead[^]
-- modified at 7:07 Thursday 12th July, 2007
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
Wouldn't it be an intersection of the two? i.e. a class has to be in the same assembly AND and derived rather than OR?
Not trying to nit-pick, just curious
|
|
|
|
|
ruanr wrote: Wouldn't it be an intersection of the two? i.e. a class has to be in the same assembly AND and derived rather than OR?
As I remember it is a UNION. The class has to be in the same assembly OR derived.
See here instead[^]
-- modified at 7:08 Thursday 12th July, 2007
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
Ready to Give up - Your help will be much appreciated.
My website
|
|
|
|
|
|
Actually, that makes it sound like you were right - and the poster below here agrees with your original opinion.
Who's bored enough to test it?
|
|
|
|
|
hi
The permissions allowed by this access level are those allowed by the 'protected' level plus those allowed by the 'internal' level. The access level is thus more liberal than its parts taken individually. This modifier should only be used for internal classes (ie. classes declared within other classes).
Rajendra Kumar Yerra
|
|
|
|
|
how we can arrange array items in descending order?
vamsi
|
|
|
|
|
Sounds that this question is asked in the Interview?
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
Hi, and welcome to the internet. Search the forums, then google, then ask. And look in your textbook before asking a homework question.
Try using Array.Sort and then Array.Reverse.
|
|
|
|
|
Ask your friend from class!
His question got a lot of response![^]
P.S.: You forgot that question: "enter a number and display next 5 prime numbers."
Maybe you forgot to turn the page of your homework assignment.
-- modified at 3:06 Thursday 12th July, 2007
I know now why you didn't asked it.
PhilDanger[^] gave the correct answere allready!
All the best,
Martin
|
|
|
|
|
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
Hi Martin,
this question is quite different from the ascending order one;
the solution is much, much harder. It probably takes more than one line of code.
|
|
|
|
|
Hello Luc,
You are write, I haven't looked to carefully at the question!
Ok, so he changed the page and found this additional question for the 'primus' studends!
-- modified at 6:15 Thursday 12th July, 2007
I found a solution in one line:
1) http://support.microsoft.com/kb/319401[^]
All the best,
Martin
|
|
|
|
|
bubble sort it... or use a listbox to display it and turn its sorted property on.
Mark
|
|
|
|