|
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 ?
|
|
|
|
|
Yes sir I have searched but not able to find suitable article...Help me sir..
Dharmaraj
|
|
|
|
|
|
|
when i click on viuew crystal reports..the output is repeated for four/five times in a crystal report
i've chacked the query its correct\dont knw wats the problem
software student
|
|
|
|
|
Hello
i try to count the i have in my form.
i put the try and catch block, in the finally i want to count the number of error i have.
or even if i don't put the try catch block how i can count the error
Thanks in advance
Assaf
|
|
|
|
|
i dont understand your question !!!!
Why you are trying to count. ?
if you use counter in Finally block it always should be 1 cause while any one error occured , code directly jumped to catch block then it will go to finaly.
|
|
|
|
|
Assaf82 wrote: i try to count the i have in my form.
Count what ?
Assaf82 wrote: i put the try and catch block, in the finally i want to count the number of error i have.
Count will be incorrect as finally will be executed all the time. Declare a variable and increment it in each catch block.
Assaf82 wrote: or even if i don't put the try catch block how i can count the error
I think it's not possible. When an unhandled error occurs, application will stop execution.
|
|
|
|
|
|
DharmarajNagarajan wrote: use a flag variable
It is not possible to use flag variable to count the number of error. when any one error will occer it will jump to Catch block, then directly move to finally block. so where you going to use flag !!!!
<br />
Try<br />
{<br />
first here !!!<br />
}<br />
catch ( )<br />
{<br />
if any error<br />
} <br />
Finaly<br />
{<br />
after error occured or not finaly here<br />
}<br />
so , counter is useless !!!!!
|
|
|
|
|
Hi, maybe this is what you want:
int errors=0;
foreach (... in collection) {
try {
...
} catch (Exception exc) {
errors++;
Console.WriteLine("Error "+errors+": "+exc.ToString());
}
}
Console.WriteLine("There were "+errors+" errors");
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I develop an application constitute from many form. the first form (Connection) is to establish the database and after the first form in the application appear
how i can close the connection form when the first form in the application appear.
this is my code:
private void btnCon_Click(object sender, EventArgs e)
{
try
{
dataConnection.Open();
MessageBox.Show(" Test Connection Succeded ", "Microsoft Visual Studio", MessageBoxButtons.OK, MessageBoxIcon.Information);
strcon = dataConnection.ConnectionString;
dataConnection.Close();
}
catch (Exception ex)
{
MessageBox.Show(" Error - Connection " + ex.Message, "Microsoft Visual studio", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
CreditCard.ToBegin n = new CreditCard.ToBegin();
n.servcon = strcon;
n.ShowDialog();
}
}
Assaf
|
|
|
|
|
Change your static void main so it runs your connection form, then your main form. Or, just have your main form be the form that starts the app, and have it show the connection form on startup.
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 )
|
|
|
|
|
|
i will explain,
i m implementing an application where there user need to print a bill when he sells some item to the customers. the bills should contains grid table and some design.
i need to know if i can make the grid with the design as a platform where nothing changes from customer to customer other then details specific to the items and customer details.
did i explaing my point of view.
Thank you
Elie
|
|
|
|