|
i had implemented the same thing using a arraylist
WHen a form is opened or clicked it is added to the ArrayList,
so u get the forms in the reverse order of the Arraylist.
Hope that works for you.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
Is there any Windows Forms components that allow to sort the content of a table by the column? That is the user press the name of the column and the table is ordered ascending and descending.
And furthermore, there is a component that allow to search using one field or several of the table?
Now we use DataTable.
Thank you
|
|
|
|
|
Hello
123456uio wrote: Is there any Windows Forms components that allow to sort the content of a table by the column?
DataGridView does that by default, and you can still do that in a ListView also by handling the ColumnClick event and sort the items youself.
123456uio wrote: component that allow to search using one field or several of the table?
Well, you can do this several ways, but a built-in method?!! I don't know! You can still search a ListView with FindItemWithText() method, but as long as you got a DataTable I prefer searching the table rather than the control.
Regards
|
|
|
|
|
Hey all,
I'm using SharpPcap to capture incomming and outgoing packets.
I can get the IP and port of the pack.
How can I tell which process is using the pack?
Thanks in advance,
Shy.
|
|
|
|
|
Run this at the command prompt:
netstat -b
This will show port no associated with the associated binaries.
|
|
|
|
|
Hmm... I'm afraid it's not gonna do me any good...
I need my application to determine that by itself...
I can pipe the result of running "netstat -b" and analyze it, but that's not the way I'm looking for...
Thanks for trying though...
Any other ideas?
|
|
|
|
|
i read an article on msdn. they say it's imposible for 2 radiobuttons to be checked if they are on the same container! is it?
rzvme
|
|
|
|
|
Yes. Radiobuttons in the same container can only have one of them selected. If you want more than one item, use an array of CheckBoxes instead.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
thought so. But i need the apperence of a radio button , and , apparrently, the behavieur of a check box. how can i do that? custom controls??
rzvme
|
|
|
|
|
I can tell you that would confuse people. They don't expect a radio button to work that way. It can be done, but you'd have to draw the control yourself.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
the people i'm designing this for haven't even heard of radio buttons or checkboxs. they can't tell the difference! but what would be easier? drawing the control (how do i do that?) or inserting each control in a container (we are talking about at least 500 radio buttons)
-- modified at 18:13 Thursday 28th September, 2006
rzvme
|
|
|
|
|
rzvme wrote: we are talking about at least 500 radio buttons
These better NOT be all on the same form!! You'll run into a LARGE performance problem...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
well, to be honest...at least 500 radio buttons (aprox 1500) on a form single form. how big of a performance problem??
rzvme
|
|
|
|
|
1500 radio buttons??? Planning on 40" monitors?? ...And still having to scroll the form around...
Oh! And that's just the radio buttons. That's also another 1500 container controls to put them in!
How big of a problem?? Depending on the machine configuration, you could be looking at 2 minutes to start that form. The Controls container tends to get slower and slower the more you add to it. Also, repainting the form will take an eternity. If you want, put a small project together to test it out. Add a button to a blank form then add the code to create 1500 panels, groups, whatever, and 1500 radio buttons to the form. Run it and watch how long it takes to create them all, then try and scroll the form around.
1500 options... You SERIOUSLY need to rethink your user interface.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
thx...i'm considering a new user interface!
rzvme
|
|
|
|
|
Hello
rzvme wrote: is it?
Sure it's not! set AutoCheck property of both RadioButtons to false. Then in the handler write the code that will Check/Uncheck the RadioButton. eg.
((RadioButton)sender).Checked = !((RadioButton)sender).Checked;
Even if you put more than a RadioButton on one container, they will be multiple selection according to the way you define in the handler.
Regards
|
|
|
|
|
Yes.
The purpose of radio buttons is to provide a single choise selection. The name comes from the mechanical push buttons used to select channel on old radio recievers. As you can only listen to one channel at a time, the previously selected button would pop up when you selected another channel.
If you want to provide a multiple choise selection, you should use checkboxes instead.
---
b { font-weight: normal; }
|
|
|
|
|
i know the kind of radio u speak, but i could always, somehow, press 2 buttons down at the same time
rzvme
|
|
|
|
|
Then use the CheckBox instead and change it's Appearance property to Button. Try it and see if you like it. It's FAR easier than custom drawing your own CheckBox control.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Yes, you could, but then you used two fingers. Perhaps if you had two mouse pointers it would be possible to press two radio buttons at the same time?
---
b { font-weight: normal; }
|
|
|
|
|
Say you have a variable named "Str" and it's value is "A", how would you change it to "B" not knowing which letter to start at? Could you use the same method for strings that represent numbers also? I have searched the net and haven't found an answer.
Thanks in advance.
Tim
|
|
|
|
|
string test = "A";
test = string.Format("{0}", (char)(test[0] + 1));
=> test = "B"
This will work, if your value is an ASCII char.
It's converted to an int , increased by 1 and converted back to a char
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I think all my values will be ASCII char's right now.
Thank you.
Tim
|
|
|
|
|
Actually it works for any character, but it's not very meaningful for all characters.
---
b { font-weight: normal; }
|
|
|
|
|
This will convert a full string. You will end up with some punctuation at the end of the alphabit.
string oldStr = "Hello";
string newStr = "";
char[] hold = oldStr.ToCharArray();
for (int i = 0; i < hold.Length; i++)
{
newStr += (char)(hold[i] + 1);
}
MessageBox.Show(oldStr + Environment.NewLine + newStr);
|
|
|
|