|
Hi,
I like using regex:
System.Text.RegularExpressions.Regex r = new System.Text.RegularExpressions.Regex(@"[ [\]]");
label1.Text = "";
foreach (String s in r.Split(textBox2.Text))
{
label1.Text += s + "\n";
}
You might use index 0 and 2 and you don't need .Trim() again.
Have fun
|
|
|
|
|
how about, in one line...
string resultString = inputString.Substring(inputString.IndexOf('[') + 1, inputString.IndexOf(']') - inputString.IndexOf('[') - 1);
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
I think you mean "extract" the value.
Regular Expression. I'd use something like:
"\[(?'Value'.*)\]"
|
|
|
|
|
Hi,
How can we create dynamic threads?
eg:- i want to create n number of threads in each event. When a incomming message come, it assign to a thread, like wise many number of messages will recive. Each time a new thread is created.
Is it possible to do so?
Thankyou
YPKI
|
|
|
|
|
|
Try looking for ThreadPool
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi All,
How to remove the form flickering in windows applications.
Regards,
Lalit Narayan
|
|
|
|
|
Results 1 - 10 of about 7,680 for c# remove form flickering with Safesearch on. (0.47 seconds)
Guess the web page!
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
|
try this[^]
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
May I borrow your spoon I have someone in the VB forum that needs feeding!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I would recommend the 'Pointy Stick' [tm]
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
|
I have code coverage tool for NUnit i.e NCover. In my test solution I added my source code as .NET dll .When I run my test solution to using NCover it gives code coverage of test solution instead of my Sorcu Code dll. How NCover can give code coverage of dll? or it is mendatory to add source code as aproject in test solution??
Ethan Hunt 008
"Licensed to Code"
10th Cloud Corp
Banglaore
India
|
|
|
|
|
This is no NCover forum. You need to look for the documentation or go the NCover forum.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
please tell me how to shutdown system by C#
thanks.
shahin gholami
|
|
|
|
|
|
hi,
i would to guide the user trough an input routine.
it's like the setup routine of a program installation.
On the first Page the user has to agree the license.
On the next select components to install, then the install path and so one.
how can get something like this? i've to ideas..
1. create a single form for each step and switch between these.
2. create a lot of panels with the controls on it and make all accept of one invisible.
is there a better option?
maybe a controll like the tabcontrol without the tabs
or a multy layer panel ?
thank you!!..
|
|
|
|
|
What you need is to take the wizard approach. No, I'm not talking Harry Potter, but boring old code.
You will need:
0. Some panel controls. One panel for each step.
1. A back button
2. A forward button
3. A finish button
4. A cancel button.
Now - izzy wizzy let's get busy - write some code to show and hide the panels and Robert's your Mother's Brother.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Create a form, with a panel which occupies most of space, leaving enough for your buttons - lets call it panelSpace.
Create your individual panel fillers by Project...Add...NewItem... UserControl - this creates a blank panel filler - lets call it panelA. Place your controls.
When you want to display the items from panelA:
panelSpace.Controls.Clear();
panelSpace.Controls.Add(panelA);
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
I wouldn't take this approach for a wizard type form. The cost of creating and destroying the controls outweigh any benefit. It is better to create them all up front with the form load and show or hide as needed.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
I would. The cost is pretty irrelevant at run time (since it is a user event we respond to the time costs are immaterial, and the memory cost is not exactly massive). The developer cost of show / hide is a lot more than maintaining separate pre-loaded panels, I think.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
There is an overhead and also another design consideration.
For the OP this does nto mater, but in general the UI and the data should be seperate. If you use databinding beween the data and UI then adding panels on the fly requires updating the databinding on the fly.
As for the extra complicatedness of show and hide [used to play that when I was younger; but that's another story] what is so hard? You have the panels in a collection and you iterate through making only one of them visible. peasy!
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Six of one; half a dozen of the other.
A personal preferance in the end, I think.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Hi
In my windows application i am receiving data's from serial port
and storing it in database (SQL2005). I am displaying the data in gridview, currently i am using a button to update and view database.
Now what i need is to display updated datas in gridview with out the button
thanks in advance
|
|
|
|