|
string aant = "this is a test,please be guided,";
string newaant="";
newaant = aant.Substring(0,aant.Length-1);
try this one.
thanks
|
|
|
|
|
|
To note why, a string is immutable meaning that anything you do to it creates a new string. If you want a mutable string, use the StringBuilder , but it really wouldn't work so great in this case.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
bertcox wrote:
string aant = samen.Length.ToString();
int aantal = (int)Convert.ChangeType(aant,typeof(int));
Just trying to understand your logic. Why are you getting the length and converting it to a string, then on the next line converting to an integer again?
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
|
|
|
|
|
when i did this it said there was a mistake
int aant = samen.Length();
So i tried another way
|
|
|
|
|
Ah! Okay. You used Length() as a method instead of Length as a property (without the brackets).
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
|
|
|
|
|
Hello Sir:
I am sorry that my english is poor. I need to adjust the space between letter in richtextbox. I already try all I can but fail. Please help me as posible as you can.
Thanks a lot!
nathan
|
|
|
|
|
The RichTextBox control doesn't support changing the spacing between characters.
The only other method I can think of is adding space characters between the characters you want to seperate out.
RageInTheMachine9532
|
|
|
|
|
|
Hello Sir,
I am working on data grid n want to show dropdown list in grid. I found in help that we can do this by declaring grid column as DataGridComboBoxColumn but I haven't find this type of object in list. There are some objects like DataGridBoolColumn, DataGridTextBoxColumn which I am already using. Could u plz tell me to do this. Thanks for ur suppport.
Inpreet Singh
|
|
|
|
|
|
Yes I know about this site had visited n unable to find my way to solution as they told me about DataGridComboBoxColumn object n which I don't find anywhere. So plz if possible tell me where I can find this object or any other wayout. Thanks
Inpreet Singh
|
|
|
|
|
|
I designed 2 form. One is MDI form(i named frmMain) and another is child form (i named frmLoggon).
On frmMain form i got a menuItem (i named menuItem1)
On frmMain Form
private void frmMain_Load(object sender, System.EventArgs e)
{
frmLoggon fLoggon = new frmLoggon();
fLoggon.ShowInTaskbar = false;
fLoggon.ShowDialog(this);
}
On frmLoggon Form i got a button (i named btExit)
private void btExit_Click(object sender, System.EventArgs e)
{
frmMain fMain = new frmMain();
fMain.Menu.MenuItem[0].Enabled = false;
this.close();
}
but the menuItem1 not disabed.
Please help me as posible as you can.
Thanks
Mr Duc Linh Nguyen
|
|
|
|
|
frmMain fMain = new frmMain();
fMain.Menu.MenuItem[0].Enabled = false;
You are just disabling the menuitem which resides on temporary MDI instantiated form. It exists only in btExit_Click procedure scope. So you need some permanent refrence to your MDI form. I'd recommend passing the MDI reference as a parameter to your child form's constructor like this:
private void frmMain_Load(object sender, System.EventArgs e)
{
frmLoggon fLoggon = new frmLoggon(<font color='blue'>this</font>);
fLoggon.ShowInTaskbar = false;
fLoggon.ShowDialog(this);
}
In your frmLoggon constructor:
frmMain _parent;
public frmLoggon(frmMain parent)
{
<font color='green'>
_parent = parent;
}
and finally:
private void btExit_Click(object sender, System.EventArgs e)
{
_parent.Menu.MenuItem[0].Enabled = false;
this.close();
}
I hope this helps.
abcdabcdabcdabcda
Don't forget, that's Persian Gulf not Arabian gulf!
Murphy: Click Here![^] I'm thirsty like sun, more landless than wind...
|
|
|
|
|
Hi, I don't know that, what i am goin to tell u is good wayout but I am sure this will work.
Ur menuItem is not disable bcoz u r make another instance of the main form n then on that u r making it disabled so u need to disable it with first instance. do one thing take a global integer set it as 0 then check on frmMain_Enter() event. if it is still 0 then don't run
Menu.MenuItem[0].Enabled = false;
set interger to 0 so that u can chk it correctly again.
other run this.
Now exiting from frmLoggon thats btExit_Click event set this interger to 1.
simple. I hope u understand what I written. Good Bye
Inpreet Singh
|
|
|
|
|
I want to set and get mouse positions in C#.I also want to get keyboard events.please help me.
mughalali
|
|
|
|
|
I guess you can access to mouse position by using Cursor object.Some thing like this:
Cursor.Position.X
Cursor.Position.Y
abcdabcdabcdabcda
Don't forget, that's Persian Gulf not Arabian gulf!
Murphy: Click Here![^] I'm thirsty like sun, more landless than wind...
|
|
|
|
|
Are you talking about getting the keyboard and mouse positions in your app, or system wide no matter what app actually has the focus?
RageInTheMachine9532
|
|
|
|
|
I want to get keyboard and mouse control in my app.Please tell me how i get or set keyboard events in my app.
Actually iam doing final year project on remote desktop control. so i need to control keyboard and mouse of remote system.
mughalali
|
|
|
|
|
mughalali wrote:
I want to set and get mouse positions in C#.
Control.MousePosition is another way.
Mazy
"Man is different from animals in that he speculates, a high risk activity." - Edward Hoagland
|
|
|
|
|
I want to get keyboard and mouse control in my app.Please tell me how i get or set keyboard events in my app.
Actually iam doing final year project on remote desktop control. so i need to control keyboard and mouse of remote system.
mughalali
|
|
|
|
|
hello there,
i wonder if anyone has this dll system.storage.schemas.dll , or know link to download it as i need namespace in System.Storage.Explorer
|
|
|
|
|
This namespace and the dll are part of .NET Framework in Windows Codename Longhorn and you cannot get it for other operating systems.
|
|
|
|
|
i want to use the namespace in a program and when i searched for it...i knew that it i in this dll but when i searched for dll over my pc i couldnt find it so tell me what to do to use namespaces in
|
|
|
|