|
edgtr wrote: I guess I can't use standard array with split function because there's no numbers declared.
Not sure what you mean by that, but yes you would split the text and (in VS2005) that would give you an array of numbers entered. From there you can use array.Length to validate that they have not exceeded the maximum and then a for loop to trim and convert each item into a number.
The only minimum requirement you would have is that the separator must be consistent and it must be entered for between every number.
string[] enteredList = entry.Text.Split(',');
foreach (string number in enteredList)
{
try
{
int value = Convert.ToInt32( number.Trim() );
}
catch
{
errorMessage.Text += number + " is not a valid number ";
}
}
|
|
|
|
|
" class to be both marked with the serializable attribute and extend MarshalByRefObject "
when will we use this concept.
-- modified at 23:28 Monday 19th June, 2006
|
|
|
|
|
Why do you ask? What put this question into your mind?
Josh
|
|
|
|
|
Hi,
I am looking for C# interview style programming problems for my self to practice with. I would like to
find some material that tests problem solving skills, efficiency of implementation as well as knowledge of
the language, though not overly complicated.
Something along the lines of algorithm implementation like fibonacci series, problems that ought not to
take more that say 20 mins max to solve. I'd appreciate your comments, suggestions, links, resources, ect.
P.S. Can anyone recommend C# equivalent books to "Effective C++" & Efficient C++"?
|
|
|
|
|
antoan wrote: P.S. Can anyone recommend C# equivalent books to "Effective C++" & Efficient C++"?
Effective C# by Bill Wagner
|
|
|
|
|
|
Colin Angus Mackay wrote: How about reading this forum. You'll find all manner of badly worded, ambiguous, incomplete questions that you are likely to find in many interview situations where the company hasn't got a clue what it is doing.
So true!! So true that it hurts. Some of the questions on these boards are so poorly worded, it seems like the person was violently throwing up while writing.
Josh
|
|
|
|
|
Some of us try!
|
|
|
|
|
check out www.mathschallenge.net
register free for "project euler" lots of good programming problems.
Best regards
//
Daniel Persson
|
|
|
|
|
|
hello
Could you please tell me how to delete entries in HKLM of windows registry(regedit) in c#.NET
Yogesh_T
|
|
|
|
|
Microsoft.Win32.RegistryKey.DeleteSubKey(String)
|
|
|
|
|
Hi!!
During my trainship I have to write a code that allows you to scroll the image using the arrow keys and, unfortunately, it's the first time I'm working with C#.net. Moreover, there should also be a button-quartett-structure, that is, 4 buttons each scrolling the image into different directions (up, down, right, left). To be more precise:
private void btnUp_Click(object sender, System.EventArgs e)
{
moveUp();
}
private void moveUp()
{
}
I'm familiar with C-language, but I have little more than no experience with object-oriented languages. Has anyone any idea which could be helpful to me??
|
|
|
|
|
An easy way would be to add a PictureBox (pictureBox2) to your PictureBox (pictureBox1). pictureBox2 will display the actual image. In the moveUp() handler, set you can change the location of pictureBox2:
private void moveUp()
{
Point currentLocation = pictureBox2.Location;
pictureBox2.Location = new Point(currentLocation.X, currentLocation.Y - 1);
}
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Goof around music jam with my brothers (with video)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
I did it in a very similar way as you suggested, and it really worked!!
Thanks a lot!!!
|
|
|
|
|
hello
i want bind only one row with the textboox is it possible like i am doing that when user selects a data from the data grid all its columns values displayed on the realted textboxes plz help me and tell me the how i can so this.
" i have find the reference of the current row clicked by the user and store it into a datarow object but what should i do further to diplay its values on the textboxes"
reply as soon as possible
|
|
|
|
|
u can try
textbox1.text = datarow["column1 name"].tostring();
textbox2.text = datarow["column2 name"].tostring();
textbox3.text = datarow["column3 name"].tostring();
.
.
.
.
.
rahul
|
|
|
|
|
Hi,i have a DateTimePicker DateTimePicker1 in my Form,when user enters a future date a message "Date cannot be in the future" displays
in my DateTimePicker ValueChanged event i have this code
TimeSpan ts = (DateTime)DateTimePicker1.Value - DateTime.Now;<br />
if (ts.Milliseconds > 0)<br />
{<br />
MessageBox.Show"Date cannot be in the future".);<br />
DateTimePicker1.Value = DateTime.Now;<br />
return;<br />
}
The message Displays twice,which makes me think the event fires twice.
how can i make it fire just once?
or is there something i am mssing?
thanks
regards paula
|
|
|
|
|
Hello
I can think of another way to do the job. Why don't you change the MaxDate property? something like:
DateTimePicker1.MaxDate = DateTime.Now;
It'll work even without messages -sometimes they are annoying to beginner users-
If you insist on showing a MessageBox, just ignore the first time , maybe:
bool SecondTime = false;<br />
void MyEventHandler(params)<br />
{<br />
TimeSpan ts = (DateTime)DateTimePicker1.Value - DateTime.Now;<br />
if (ts.Milliseconds > 0 && SecondTime)<br />
{<br />
MessageBox.Show"Date cannot be in the future".);<br />
DateTimePicker1.Value = DateTime.Now;<br />
SecondTime = false;<br />
return;<br />
}<br />
SecondTime = true;<br />
}
|
|
|
|
|
Paula,
The reason it is firing twice is because you are changing it twice; once when you select on the form and another with your line of code just before your return where you change it back to the current date.
HTH
|
|
|
|
|
The one time I experienced something like that, I found that I had done a subscription to the event twice for that event handler. So do a search in your code for += and make sure you haven't done that.
|
|
|
|
|
Do you know that how to implement new tricks in the registry through coding
if u have solution then reply as soon as possible
PRADEEP
|
|
|
|
|
Uhhhh... "new tricks"??? What does that mean?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi
means Tips & tricks which r available on the net. they give the menual implementetion but i want to implement them with the coding
(NOW ITS OK???)
-- modified at 10:55 Monday 19th June, 2006
|
|
|
|
|
"Tips & Tricks" still means anything. What are talking about??????? Just changing values in the registry?? Coding these depends on exactly what needs to be changed and what the possible values or range of values are. Most of what you write will be user interface code. Changing the values in the registry is easy, example of which you can find here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|