|
Yes but isnt it possible to access both like Columns[integer] and Columns[String]?
Then i dont have to know the actual index for the column i seek. Thats the beauti
|
|
|
|
|
See, I know that Columns[string] works so without further evidence I am forced to assume that you are not using a valid string value. My post was suggesting that you look at the Name properties of all the columns to find your error. Apparently my short post was not enough to steer you in that direction.
|
|
|
|
|
Oh man! You where right, what a god damn rockie misstake
In the database the columns name i CustomerID so naturaly i tryed that. But the true name was customerIDDataGridViewTextBoxColumn
Thanks for the help!
|
|
|
|
|
hi,
I have a textbox. how can i avoid that a user types strings in it, bud only decimal values?
thanx
|
|
|
|
|
Djavid j wrote: I have a textbox. how can i avoid that a user types strings in it, bud only decimal values?
MaskedTextBox could be used, or you could handle the Key events (KeyDown, KeyPress, KeyUp) and look at what was typed there, only allowing characters that pass your criteria through.
There may be other ways.
Good Luck!
It isn't enough to do well in life.
One must do good when and where one can.
Otherwise, what's the point?
|
|
|
|
|
Or use a NumericUpDown instead.
|
|
|
|
|
|
I think it is pretty easy to prevent user from entering any text value, we may use following lines of code in KeyPress event of Text box–
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (Char.IsLetter (e.KeyChar))
e.Handled = true;
}
I hope this helps .
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Is anyone of you familiar with Anti-Grain Geometry? I just stumbled across it this week and would love to use it in my program but I can't figure out HOW to use it!
I am trying to use the C# wrapper created by the guys at CreativeDocs.Net --> http://www.creativedocs.net/
Just so you know, I have exhuasted google trying to find some kind of documentation.
Any pointers would be greatly appreciated!
Richard
may your code be error free.
(okay, maybe two lines.)
|
|
|
|
|
Ohh!! You've found one of those "figure it out on your own" libraries.
Never heard of it. Never used it. My first source of information would be the people who wrote it, which appears to be Epsitec SA[^].
|
|
|
|
|
how would i get me Visual C# to load a image i have loaded to a resource files in this script:
///
/// Load your graphics content. If loadAllContent is true, you should
/// load content from both ResourceManagementMode pools. Otherwise, just
/// load ResourceManagementMode.Manual content.
///
/// <param name="loadAllContent" />Which type of content to load.
protected override void LoadGraphicsContent(bool loadAllContent)
{
if (loadAllContent)
{
load(Resource1.logo);
}
// TODO: Load any ResourceManagementMode.Manual content
}
private void load(object logo)
{
throw new Exception("Help i don't know what i'm doing!!!");
}
I have tried a hundred differnt ways and i keep gettign errors. Plz Help if you can
Michael
(Up and coming Game programmer)
EST
|
|
|
|
|
Please give your messages more meaningful titles.
__________________________
Don't drink and derive.
Alcohol and calculus don't mix.
|
|
|
|
|
MMaines2005 wrote: how would i get me Visual C# to load a image i have loaded to a resource files in this script:
If I wanted to, say, load an image from a resource and display it in my PictureBox, I might do this:
myPictureBox.Image = Properties.Resources.myImageToDisplay;
It isn't enough to do well in life.
One must do good when and where one can.
Otherwise, what's the point?
|
|
|
|
|
Are you using XNA? If so, here is a handy site you might like to refer to:
http://www.xnatutorial.com/[^]
Me: Can you see the "up" arrow?
User:Errr...ummm....no.
Me: Can you see an arrow that points upwards?
User: Oh yes, I see it now!
-Excerpt from a support call taken by me, 08/31/2007
|
|
|
|
|
hi everyone,
I have a combobox wit time values like 00:00:00, 01:00:00 in it...i want to save this values in the sql server database table, when the cliks on save time...the field in the table is from DateTime Type...the problem is that there wil save also a date value in the table, like this: 1/1/1900 1:00:00 AM ...how can i save only the time from my combobox: 01:00:00, without the date value?
thanx
|
|
|
|
|
Don't save it to a datetime field. However, does the date part really matter? If you are only interested in the time part, this is easily obtained from the DateTime and you can ignore the date part.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Or save it as an integer:
1) Number of seconds after midnight
2) 12:34:56 saved as integer 123456
|
|
|
|
|
|
Hi!
I want to execute some code when I click a picturebox, but I don't know how, and I can't find an answer anywhere. So could some kind person out there take some time to teach me?
Thx Dan
|
|
|
|
|
Handle the click event of the picture box
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
DanSteeve wrote: I want to execute some code when I click a picturebox, but I don't know how, and I can't find an answer anywhere. So could some kind person out there take some time to teach me?
You can just handle the Click event by creating an event handler that does whatever you want it to do.
example:
myPictureBox.Click += new PictureBox.Click(myFunctionToDoSomething);<br />
<br />
<br />
private void myFunctionToDoSomething(object sender, EventArgs e)<br />
{<br />
}<br />
Seems like that would do the trick.
I'm assuming the code you want to execute is part of your application, of course. You could fire off another process within the event handler, if you wanted.
Hope that helps!
It isn't enough to do well in life.
One must do good when and where one can.
Otherwise, what's the point?
|
|
|
|
|
To all,
i have a c# application that have one textbox only..
i want to drag a doc file to that textbox..at the moment i drag that file ,
the address/path of that file should appear on that textbox...
pls help
Munish rathore
|
|
|
|
|
|
Look at the AllowDrop property for the TextBox class. It's pretty self explanatory.
|
|
|
|
|
I tried to compile source c# files from inside code as follows:
...
string[] filesArray;//array of c# files full path
CodeDomProvider codeProvider = CodeDomProvider.CreateProvider("c#");
CompilerParameters parameters;
...
CompilerResults results = codeProvider.CompileAssemblyFromFile(parameters, filesArray);
Compiler reported error: Line number 0, Error Number: CS2032, 'Character '\v ' is not allowed on the command-line or in response files;
I have red that c# compiler doesn't accept characters from 0 to 31 in ascii table plus '|' character.
I didn't manage to remove those characters from source files.
What should i do?
Mile
|
|
|
|