|
Hi,
I have a MainMenu which have several "categories", in these "categories" I have several MenuItems with checkable Sub-MenuItems. A few of my users have complained about the fact that the menu collapse each time they have checked a MenuItem, is there any way to make the menus stay expanded after clicking a checkable MenuItem?
I hope you can understand this a bit diffuse description.
Best regards,
Daniel
|
|
|
|
|
Hi,
i think you have to edit the menu class a little.
But I don't know how, sorry.
mfg z.c
|
|
|
|
|
Hi,
i'am trying to find some Information about how to Do Bandwidth Limitation in C#. But
it's hard to find something usefull. My Goal is it to write an Application like NetLimiter with a WebInterface to change configuration.
At the moment I'am trying to get some Information about how to limit the Bandwith
for a single Process. I've read something about Winsock LSP & QoS but I can't figure out if this technologies could help me and how I can use them.
So if you got any Tip or just a googel Search Str tell me please
mfg zc.net
-Sorry for the BAAAD English-
|
|
|
|
|
This comes up so often and the project gets dropped just as often because you have to write a device driver to handle the throttling of bandwidth. It's really not recommended you do this in C#. You can do it in Managed C++ though. This way, you'll have an easier time exposing an interface usable by a management application.
You won't find much information on the web, simply because it's a niche product and there is little demand for it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello dear all
how to find scrollbar position in datagrid i have more data in datagrid and i have select last row in datagrid but when grid is referesh the scroll has gone to start position how i can stop the scroll when grid is referesh
please tell me
|
|
|
|
|
I'm trying to take a variable call it intTotal
If I have the number 1234567890 I want to extract the 90 first and put it into a label, then the 78 and put it into a 2nd label, then the 56 and put it in a 3rd label and anything else will be put into a 4th label. The number is completely random and is differen lengths from 0-whatever. Any ideas on how to make this work?
|
|
|
|
|
The following code snippet enables you to split a number into last two digits and all previous digits. Hope it gives you a starting point.
int x = 1234567890;
int y = x % 100;
int z = (x - y) / 100;
www.troschuetz.de
|
|
|
|
|
I tried that originally but it would either a. work or b. work but bring a random number that didn't make sense or c. didn't work at all. The size of int x as you put it...is completely random it could be 50 one time and 234503 the next. So it isn't a static variable. Here is the piece of Code I'm working on.
<br />
private void ButtonTotal_Click(object sender, System.EventArgs e)<br />
{<br />
int intPrimary;<br />
int intBuild;<br />
int intFuel;<br />
int intTotal;<br />
int intCP;<br />
int intSP;<br />
int intGP;<br />
int intPP;<br />
<br />
intPrimary = (Int32.Parse( PrimaryCost.Text) * Int32.Parse( PrimaryQuan.Text ));<br />
intBuild = (Int32.Parse( CompCost1.Text ) * Int32.Parse( CompQuan1.Text )) + <br />
(Int32.Parse( CompCost2.Text ) * Int32.Parse( CompQuan2.Text )) +<br />
(Int32.Parse( CompCost3.Text ) * Int32.Parse( CompQuan3.Text )) +<br />
(Int32.Parse( CompCost4.Text ) * Int32.Parse( CompQuan4.Text ));<br />
intFuel = (Int32.Parse( FuelCost.Text ) * Int32.Parse( FuelQuan.Text ));<br />
intTotal = ( intPrimary + intBuild + intFuel )* Int32.Parse( Times.Text );<br />
<br />
intCP = intTotal % 40;<br />
intSP = intTotal % 40;<br />
intGP = intTotal % 40;<br />
intPP = intTotal % 40;<br />
<br />
TotalCP.Text = Convert.ToString( intCP );<br />
TotalSP.Text = Convert.ToString( intSP );<br />
TotalGP.Text = Convert.ToString( intGP );<br />
TotalPP.Text = Convert.ToString( intPP );<br />
}<br />
|
|
|
|
|
I would probably use string parsing.
str = intTotoal.ToString("#");
lbl1.Text = str.SubString(str.Length - 2,2);
lbl2.Text = str.SubString(str.Length - 4,2);
lbl3.Text = str.SubString(str.Length - 6,2);
lbl4.Text = str.SubString(0,str.Length - 6);
Remember to put an 'if' test before each statement to check if the string is long enough to do the SubString requested.
|
|
|
|
|
it says i need a definition for SubString and Length.
|
|
|
|
|
Sorry,
It's Substring not SubString. Thats what I get for relying on intellisense too much. Here is working code copied from the vs editor:
int i;
string str;
i = 1234567890;
str = i.ToString();
lbl1.Text = str.Substring(str.Length - 2,2);
lbl2.Text = str.Substring(str.Length - 4,2);
lbl3.Text = str.Substring(str.Length - 6,2);
lbl4.Text = str.Substring(0,str.Length - 6);
Substring and Length are members of System.String
As long as you have "using System;" at the top of your *.cs file, you should be able to use code like this.
|
|
|
|
|
it worked thanks...sorry if I had sounded stupid I've only been programming for about 3 weeks.
|
|
|
|
|
Actually It works the first time I run it...then after that it comes up with this error.
[code]An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
Additional information: StartIndex cannot be less than zero.[/code]
Any ideas?
|
|
|
|
|
Obviously your string is to short, so that the expression str.Length - 2 and/or str.Length - 4 and/or str.Length - 6 is/are less than zero and the String.Substring method fails (remember the random length of your number).
So you should check the length of the string before you retrieve the substrings.
P.S: If you reply to your own posting, you're the only one that gets notified and as this thread is pretty old, most likely nobody will ever see your new posting.
www.troschuetz.de
|
|
|
|
|
hello
i am developing a term project of sending sms in pakistan and aslo world wide i have searched so many webservices.one is tiscali webservices. actually when i send message the notification message appear that message has been sent but i did not receive message please help me give me early reply and please send me links of webservices. thanks. ok bye
|
|
|
|
|
Hello dear all
now i am working C# technology and i am developing a application software. i am using a tree view control and having one problem in tree viwe control when i have expand all the node and if tree is refersh then all expained node colleps
Please help how we can expand again all node after referesh the tree view control by programming.
|
|
|
|
|
I have a big problem :
I'm also trying to control the port[open port , close port ,...] and i write the following code in C#:
Socket serialPort1 = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
System.Net.IPAddress LocalIPAddress = System.Net.IPAddress.Parse("127.0.0.1");
System.Net.IPEndPoint LocalEndPoint = new System.Net.IPEndPoint( LocalIPAddress,80 );
serialPort1.Connect(LocalEndPoint);
serialPort1.Blocking = false;
serialPort1.Shutdown(SocketShutdown.Both);
serialPort1.Close();
I think after the program execute i cann't open any web page because the port (80) as the http and when i closed it i cann't open any web page .
but in fact after the program execute not happened any thing i can also open any web page ????!!!!!
what is the wrong in last code ????!!!
Please some one help me
thanks.
|
|
|
|
|
You can't shutdown a remote socket by closing your end. Once a connection gets established with the server, the server communicates to the client using a different port. When you shutdown the connection, it is that port that closes down.
In your case, the webserver will keep running. Just think of it, if a webserver shuts down simply because a client closed a connection, it would be unusable..
Regards
Senthil
|
|
|
|
|
Hello,
I need to be able to find the first row where the first eight columns are empty. Right now I just get a cell range, loop through the first eight values, and if I didn't find anyhting, then the row is empty (at least the first eight cols are empty) and I continue to the next row.
Is there a method that already exists that I can use to achieve the same results? It seems inefficient to have to read the first eight values of every row until you find an empty one. If I hae many rows, and the next to last one is empty, it would take a while to find that out.
It would also be ok if I could fid the first totally empty row.
I looked at the UsedRange of the sheet but it includes empty lines in its range.
Thanks for the help,
-Flack
|
|
|
|
|
I know what you mean, I think the UsedRange includes any cell that has formatting, which can be quite annoying.
Try this
Range rng = Sheet1.UsedRange;<br />
object[,] data = null;<br />
data = (object[,])rng.Value;<br />
Marshal.ReleaseComObject(rng);
Looping through the array is much faster then looping through cells.
|
|
|
|
|
Don't know if this will help you, but I'll give it a try. In my VBA makros I use the following code and it works great.
ActiveSheet.Cells(ActiveSheet.Rows.Count, 1).End(xlUp).Row
/* Edit
The above code returns the last non-empty row, so you'll have to increase the result by one
*/
www.troschuetz.de
|
|
|
|
|
I have read enough about Alternate Data Streams (ADS) to know that copying files from an NTFS file system to (say) FAT32 will lose them; and I think it may be possible to use one CD-R format (?UDF) and retain them.
Also, I have corresponded with the WinZIP folks and they say that they have occasionally had requests for the ADS to be archivable in their ZIP package, but it's not a large enough number of requests for them to include it as a feature.
I am designing an application that uses ADS to keep extensive metadata (well beyond Custom properties, and moderately large amounts of text and XML) that describe GIS files, and would like to be able to retain the streams on a medium such as CD-R or DVD.
What alternatives do I have to do that?
I would prefer to write something myself using C# or VB.NET - so the useful APIs would be a first step.
Perhaps someone with some experience in programming against the NTFS system and its data streams could give me a few pointers?
Ian Thomas
|
|
|
|
|
First of all, I'm fairly new at programming in C#, so if my question seems rediculously simple, I apologize.
I'm trying to build an application that uses the OldDbConnection (Jet 4.0) to access a Microsoft Access .mdb file. So far, the only way I've found to get it to link up properly is to give it the full path of the database file. This is fine for my system, but I want to be able to package it up and share it. Is there a shorthand path I can give it to indicate that the database file is in the same directory as the executable, or will I need to set up some variable?
If I'm going to have to store the path somewhere, what is the preferred way to do that in .NET?
Again, I realize that some of the questions deal with basics, but I've gotta start somewhere. Any help would be greatly appreciated.
--In a world without fences, who needs Gates?
|
|
|
|
|
Application.StartupPath should give you the executable's path. Check here[^].
Good luck!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
hello can some one plase help me construct a list in c# that will do this
example on a list
name = new list();
name.myname = "michael hansen";
subname = new list();
subname.myname = "michael son martin";
subname = new list();
subname.myname = "michael sister jane";
just a little example what the list will look like
michael hansen root
---------son martin child
---------sister jane child
claus hansen new root
---------son martin child
---------sister jane child
and so on
i must be in Inode or list or item function in c# it has to be fast
no use of treeview or xml or any part of controls
just plain linked list wiith a like parant and child
plase mail at michaelhansen555@msn.com
if some one have a source code for that kind of list
tanks
best regards
michael hansen
|
|
|
|