|
buddy you can also write any value in NumericUpDown
Becoming Programmer...
|
|
|
|
|
hi!
i have used this chunk of code for taking only positive decimal and interger values, it worked successfully for me. you can modify it according to your need. it is basically keypress event of textbox...
private void onKeyPress(object sender, KeyPressEventArgs e)
{
char[] myNum = new char[12] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '\b','.' };
bool blnNumFnd = false; //for keeping track of decimal
foreach (char c in myNum)
{
if (e.KeyChar == myNum[11])
{
String txt = ((TextBox)sender).Text;
if (!txt.Contains("."))
{
blnNumFnd = true; //means its decimal value and user can't enter another decimal again!
break;
}
}
else if (e.KeyChar == c)
{
blnNumFnd = true;
break;
}
}
if (!blnNumFnd)
e.KeyChar = '\0';
}
hope it will work for you!
Regards,
shazjazz
|
|
|
|
|
Thank you shazjazz..its helped me out...
<marquee>hemanth
|
|
|
|
|
Hi Shanjazz can u send me the code for entering Positive values and negative values also..i tryed by changing the code but i didn't get the result correctly.I am waiting for your code for entering Negetive,Positive,Decimal values in textbox
hemanth
|
|
|
|
|
I created a grid which shows categories. I want to add paging to grid showing only 10 categories for each page.
According to requirement, first categoryid column of grid must be invisible. And want to replace y with yes. To achieve this I have written code as below
protected void gdViewCategory_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.DataItem != null)
{
e.Row.Cells[1].Visible = false;
if (e.Row.Cells[4].Text == "y")
e.Row.Cells[4].Text = "Yes";
if (e.Row.Cells[4].Text == "n")
e.Row.Cells[4].Text = "No";
}
}
And to add paging I have written code as below:
protected void gdViewCategory_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gdViewCategory.PageIndex = e.NewPageIndex;
BindData();
}
It displays required result, but the header of gridview shows all column names.
And therefore row data is not under right columns.
|
|
|
|
|
Hi,
Have you Un-check Auto Genrate Fields Option.
Tri if it shaws all the Columns after customizing.......
Thanks
|
|
|
|
|
i need to use the namespace Microsoft.Office.Interop.Outlook.
For that when i searched in google regarding which dll to be referred i came to know that when Microsoft Outlook 11.0 object library dll is referred,
two dll(Microsoft.Office.Interop.Outlook and Office.Core) will automatically get refernced.
When i tried both dll are getting automattically added to the project but still i couldnt use Microsoft.Office.Interop.
Please help me out.
Thanks,
Srikanth
|
|
|
|
|
|
Aiyo!! i have the ssembly. Infact i have added the reference in my project.
Microsoft oulook 11.0 object library.dll which inturn refer MicroSoft.Office.Core and Microsoft.Office.Interop.Outlook assemblies.
But i couldnt use the namespace Microsoft.Office.Interop.Outlook namespace in my code.
And for your information google is available in India and we know how to get the stuff from google.
Thanks for your reply.
Thanks,
Srikanth
|
|
|
|
|
Christian Graus wrote: Is google blocked in some countries ?
No. But some people have a block in thier brain (mental block) which causes them to shirk doing homework and put dumb questions in our discussion boards. How many times we have to remind them to read ForumGuidelines before posting.
Did you observe Survey forums on Monday? There were hilarious code questions there!
|
|
|
|
|
Deepak,
i am not the person who is lazy to do the work and just ask for help blindly. i just had a problem in using a namespace.Asked for the reason.
I never ask just like that i need code for implementing this that.
Thanks,
Srikanth
|
|
|
|
|
Hi
How To Start Service After Install Setup Program
Thanx
|
|
|
|
|
you have tom use "System.ServiceProcess.dll"
using System.ServiceProcess;
Now use ServiceControler class to strat or stop any services !!!
e.g
<br />
ServiceController iis = new ServiceController("W3SVC");<br />
iis.Refresh();<br />
iis.Start();<br />
ucan check status of services using
<br />
ServiceControllerStatus.Stopped <br />
|
|
|
|
|
Hi,
I want to filter non numeric characters in one of my text boxes (windows form). I used following code for that.
________________________________________________________________________________________________
if ((e.KeyCode >= Keys.D0 && e.KeyCode <= Keys.D9) ||
(e.KeyCode >= Keys.NumPad0 && e.KeyCode <= Keys.NumPad9) ||
(e.KeyCode == Keys.Back) ||
((e.KeyCode == Keys.Oemcomma || e.KeyCode == Keys.OemPeriod || (e.KeyCode == Keys.Decimal)) &&
(txtNetAssetValue.Text.IndexOf(",") == -1 && txtNetAssetValue.Text.IndexOf(".") == -1)))
________________________________________________________________________________________________
I could filter all the non-numeric characters except "!@#$%^&*()_+" .
Can you tell me the group they belonging?
Thanks!!!
jayasshc
|
|
|
|
|
try Char.IsNumeric and Char.IsControl and then add your check for decimal characters.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
How can I get first clicked button’s image and second clicked button’s image in runtime application.
(I built the buttons automatically by coding in form loading. I will use tag of button’s image but I can’t define first clicked button’s ... and second clicked button’s.....For example I want to show “perfect” in messagebox if first clicked button’s backgroundimage is the same to second Clicked Buton’s backgroundimage. How can I write first clicked..... and second clicked ..... by coding to compare)
|
|
|
|
|
by checking the status of the button if button1.clicked==true then so and so...
|
|
|
|
|
If they handle the same click event, you can use the sender property to access the button that was pressed.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for your quick reply,
Can you explain it in a small exampe by codes.
|
|
|
|
|
protected void ClickEvent(object sender, eventargs ea)
{
Button b = sender as Button;
// b is now the button that was pressed
}
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks,
From this how can I indicate first and second clicked buttons. Is this only one button which is clicked?
Can you write as codes.(I am beginner to programming)
|
|
|
|
|
Hi,
How is it possible to clear the value of a particular cell which is positioned on a particular row and column?
Is there a functionality such as:
DataGridView1[intColumnIndex, row.Index].Value = ""
Thanks
|
|
|
|
|
Why don't you give it a try to see if it works?
|
|
|
|
|
Hello Post simple articles regarding Datasets and a article about databinding in detail...
Dharmaraj
|
|
|
|
|
DharmarajNagarajan wrote: Hello Post simple articles regarding Datasets and a article about databinding in detail..
don't you know how to search ?
|
|
|
|