|
Hi,
I would say you cant set priority for the normal timer events:
all Windows.Forms.Timers get their event handled by the UI thread, hence at the same priority; it is unclear (I guess unspecified) in which order they would fire assuming
more than one of the timers is supposed to fire at a specific point in time
(maybe you will find my timers article interesting, it tells you more about the
resolution of the timer classes).
all other timers (Windows.Threading.Timer and Windows.Timers.Timer), as well as other
asynchronous events, typically use their own thread to service the event.
Here too, you typically dont control the thread's priority,
and the order of concurrent events is unspecified.
of course, you could organize a periodic event at a higher priority by using
your own thread, set at higher (maybe real-time) priority, and using a high-precision
timer (again see my article).
Hope this helps.
|
|
|
|
|
i have in a textbox "1+2+3". How can i convert this string to find the result aka 6 ?
|
|
|
|
|
"1+2+3" from the textbox is just a string. How to interpret it is entirely up to you. So, in order to obtain the result, you need to write your own parsing rules and calculating logic.
Best,
Jun
|
|
|
|
|
ok! But how could i interpret "+" like + operator ?
I am thinking to split the string "1+2+3", 1,2 and 3 are numbers, integer, but "+" what type it is?
|
|
|
|
|
That type of string can be split to two categories: operands and operators. Operands are simply numbers. With operators, you cast them one by one. Pseudo code may be like this:
switch(operator1)
{
case "+":
result = operand1+operand2;
break;
case "-":
result = operand1-operand2;
break;
}
I am not aware of any shortcuts in this regard.
Best,
Jun
|
|
|
|
|
First you need to split "+" into an array
Then each of the array value needs to be converted or Parsed and added
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|
|
|
|
This is probably very simple but im having trouble getting my head around it.
Ive tried making a temporary list view item which stores the selected list view item,
Then move the selected list view item + 1 up one,
Then the selected list view item + 1 = the temporary,
But i keep getting errors.
Can anyone help me?
|
|
|
|
|
Hi, what is the View (LargeIcon, Details, ...) ?I have some experience with setting
icon positions on the desktop, which is a listview with View=LargeIcon.
|
|
|
|
|
|
Can you send me your code so that we can pin point the error !!
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|
|
Here is my code, im not sure if im even tackling this problem correctly.
<br />
private void listView1_KeyDown(object sender, KeyEventArgs e)<br />
{<br />
if (e.KeyValue == 40)<br />
{<br />
ListViewItem temp = new ListViewItem();<br />
ListViewItem temp2 = new ListViewItem();<br />
for (int i = 0; i < listView1.SelectedIndices.Count; i++)<br />
{<br />
if(listView1.SelectedItems[i].Index + 1 <= listView1.Items.Count)<br />
{<br />
temp = listView1.Items[listView1.SelectedItems[i].Index + 1];<br />
temp2 = listView1.Items[listView1.SelectedItems[i].Index];<br />
<br />
listView1.Items[listView1.SelectedItems[i].Index + 1] = temp2;<br />
listView1.Items[listView1.SelectedItems[i].Index] = temp;<br />
}<br />
}<br />
}<br />
}<br />
|
|
|
|
|
Hi,
there is a bug: if the last listview item is selected (the one with index=count-1),
then temp will refer to the one with index=count, which exceeds the array.
there probably is a second bug: if items 2 and 3 are selected, then maybe
first 2 and 3 get swapped, then 3 and 4 get swapped, which might not be what
was intended.
index 0 1 2 3 4 5
So original A B C D E F
becomes A B D C E F
then A B D E C F
Also I am not sure the items in SelectedItems are in numerical
order, in selection order, or random order.
Furthermore, there is no need to create new ListViewItems (temp, temp2).
Hope this helps
-- modified at 3:39 Monday 16th April, 2007
|
|
|
|
|
Im really stuck
|
|
|
|
|
Since this is not a question, I will only give a piece of advice:
- try to formulate a good, detailed and complete description of what you
want to achieve before you start implementing something
(e.g. what is swapping meant to do when three things are selected ?)
- then implement, test and debug it
- if stuck in a very specific thing, read the documentation, search Google or
codeproject, possibly launch a question here
- if stuck in general, publish all the above plus detailed description of the
behavior you observed and what it is you dont like about it.
|
|
|
|
|
I use below conection string, but there's appear error in remote connection.
On same pc connection is OK.
mConnection = new SqlConnection(@"data source=servername\sqlexpress;" +
"database=databasename;" +
"UID=user;PWD=pass;");
Error mesage is:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Server Authentication is SQL Server and Windows Authentication mode.
Allow remote connections to this server is set.
What may cause this mistake?
Thanks.
|
|
|
|
|
Hi,
Your problem is that SQLExpress server by default has Named Pipes and TCP/IP protocol disabled. In order to connect to SQLExpress on different networked PC you should enable at least one of this protocols and restart your SQLExpress service under:
SQL Server Configuration Manager :: ... Network Configuration :: Protocols for ... :: Named Pipes and (or) TCP/IP.
Also it could be (but not necessary) required to setup client protocols on client PC.
Some other settings may be required on your firewalls and ...
After that, it should works.
damir@iit.com.hr
|
|
|
|
|
Thanks a lot Damir, it's works!!!
|
|
|
|
|
Go to the SQL Server 2005 configuration and set the required seting for remote connection
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|
|
I have a NotifyIcon object. The user sees it near the clock on the desktop.
Now, I want to tell the user that something happend (Like when Windows says
that updates are ready to be installed)- a small baloon that comes out of
the icon.
Does anyone knows how to do it?
C#
|
|
|
|
|
Have you tried the ShowBalloonTip method?
---
single minded; short sighted; long gone;
|
|
|
|
|
Can you tell me more clearly. And I have VS 2003. Is that class here?
C#
|
|
|
|
|
C# programming wrote: And I have VS 2003. Is that class here?
That would explain it. That method is only available in framwork 2.
---
single minded; short sighted; long gone;
|
|
|
|
|
There are several articles on this topic. Search CP !
|
|
|
|