|
string a= "example string 4444";
int numToRemove = 5;
a = a.Remove(a.Length - numToRemove - 1, numToRemove);
|
|
|
|
|
Hi,
use the substring function.
eg. a.SubString(0,14);
modified 27-May-14 4:57am.
|
|
|
|
|
Hi,
I am creating a deployment project. Everything works well except the uninstall of the previous version. if I look in the Programs and Features window in Windows 7 the new version is updated in the version column, but the application still picks up the old version. When I run the msi again it asks for repair or uninstall. I uninstall, run it again, install and then it works.
Can anyone maybe help.
Thank you
|
|
|
|
|
my app. send SMS in bulk
wat i want is to display the progress of SMS send.
Thread.delay (1000); is working but im not able to display that progress in lable.
why and wats the remedy???
|
|
|
|
|
if your app is a WinForms app and all of your code is running on the main thread, then Thread.Sleep(1000) will stall the GUI, which is not really acceptable; you should either use a timer to create a period of inactivity (a Windows.Forms.Timer keeps you on that main thread); or better yet, delegate the slow operations to another thread, have a look at BackgroundWorker.
Warning: you may want to read this[^].
|
|
|
|
|
Dear friends,
Small clarification.
Can some one tell me which one will be faster?
int a =100000;
string b = a.tostring();
string c = convert.tostring(a);
string d =""+a;
By
Joe.I
|
|
|
|
|
I think in release mode B and C have the same result. But for the purpose a.ToString() is the best one.
The D case is a coding horror for me.
|
|
|
|
|
Short answer: test it
I took a little look with the Reflector and I'm willing to hazard a guess: the first one. Because: the first one just calls Number.Format(something) which is an extern function, the second one calls int.ToString(some stuff) so basically it just adds a method call (which could be inlined by the JIT engine) and the last one also does some string appending, to which JIT magic may also happen, it might have an "if (first.Length == 0) return Second" and then the optimizer in the JIT compiler might decide that since the string is a constant, its Length is also constant, and then it might optimize that test away and skip the string appending completely.
That is very optimistic.
So, still test it..
Who knows, maybe it's even possible to write a faster IntToString method? I would look into it. Especially if a lot is known about the input (probability distribution etc). I wouldn't count on it, but you don't know until you try..
|
|
|
|
|
I don't know exactly. Test it!
However if you use a lot of int to string and then something like "string total = a+b+c+.... "
where a,b,c are strings obtained from ints than StringBuilder is the fastest and less
memory hungry.
|
|
|
|
|
I want to know how can I place a button or clickable label on the windows task bar so when clicking it will show a window just like Microsoft Windows Search?
|
|
|
|
|
jrahma wrote: I want to know how can I place a button or clickable label on the windows task bar so when clicking it will show a window just like Microsoft Windows Search?
Sounds like you're looking for an "Explorer Band"[^]
I are Troll
|
|
|
|
|
Google for "Windows 7 Taskbar .NET Integration" and you'll find an SDK you can use that might supply what you need.
|
|
|
|
|
Hi
I have cretae one table in database right?
then added Record in datatable finaly i make update datatable using commmand adapter
It work fine with added row
but when i make delete row then it Give error Like
"Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information"
Thanks In Advance,
Jitendra
|
|
|
|
|
You need to use the data adapters delete command to delete a row
More here[^].
There are only 10 types of people in this world — those who understand binary, and those who don't. |
|
|
|
|
|
Dear all,
I made a setup project for my application. How can i set my onw logo in the setup wizard windows?
Thanks
|
|
|
|
|
In the user interface designer you can change the banner bitmap property to your own image.
|
|
|
|
|
hi,
Can I change the buttons labels from the setup ?
I mean: a button label "NEXT" to this "->", or a button label "CANCEL" to "EXIT SETUP"
Cheer's,
Alex Manolescu
|
|
|
|
|
Not in the Visual Studio designer, though I believe you can control that if you use WIX[^] or some other installer designer to create your installer package.
|
|
|
|
|
It's not easy, but you can add custom dialogs to Visual Studio setups: link.
|
|
|
|
|
Thanks,
I found that, however there is another issue, the size of the logo.
I made it 500px/70px, bud still it takes all the space on the welcome text section. I even made it smaller then 500/70 px, it still does not fit into the wizard
modified on Tuesday, January 12, 2010 7:51 AM
|
|
|
|
|
I have developed a web applicaiton in c#
I have created a test case using c# but how do i run it with "gui runner"
There is no executable ?
Would appreciate any help or pointers to information source.
Thank you in advance
G.
|
|
|
|
|
Hello, I have a routine that loops through all the controls on my form.
The purpose is to set the Edit Mode or Read Only mode.
To find textboxes and buttons inside a TabPage or GroupBox the routine runs recursive.
To convert a Windows.Forms.Control in to a Texbox I validate and use ..
if (c is TextBox)
{
ToggleTextBox((c as TextBox), flgEditMode);
}
So Far So Good.
If I do the same for a ToolStripButton I get the message:
Cannot convert type 'System.Windows.Forms.Control' to 'System.Windows.Forms.ToolStripButton'
Please can you help me with a work around?
Kind regards Arjen
|
|
|
|
|
Hello,
The ToolStripButton class doesn't Inherit from Control .
Inheritance Hierarchy:
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.ToolStripItem
System.Windows.Forms.ToolStripButton
So you have to look for the ToolStrip class (which inherits from Control ) an than iterate over the Items property.
Like this:
foreach (Control c in this.Controls)
{
if (c is ToolStrip)
{
ToolStrip ts = c as ToolStrip;
foreach (ToolStripItem tsi in ts.Items)
{
ToolStripButton tsb = tsi as ToolStripButton;
if(tsb != null)
{
...
}
}
}
}
Hope it helps!
All the best,
Martin
|
|
|
|
|
Dear Martin,
Thank you for your quick reply and solution!
With kind regards,
Arjen
|
|
|
|
|
ArjenGroeneveld wrote: Thank you for your quick reply and solution!
Glad I could help!
All the best,
Martin
|
|
|
|