|
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
|
|
|
|
|
Hello,
I have two servers at different locations and I want to match the timestamps generated by one server.
I have an Idea of generating timestamp for GMT 0, this means that timestap will be same across all servers. How can I generate this timestamp? any idea?
Pavas
|
|
|
|
|
DateTime.ToUniversalTime()
only two letters away from being an asset
|
|
|
|
|
I guess it will work...
Thanks a lot
Pavas
|
|
|
|
|
hi guys,
I have this sql query:
string commandtext = "select Res_nr from AfwTarieven where Res_nr='"+resid+"'";
now i want that if he find a Res_nr that is equal to resid, do something:
{}
bud if there is no Res_nr that is equal to my resid, then do somthing else.
How can i write that in code? i had something like this , bud i got a error:
mycomm = new SqlCommand(commandtext, myconn);
int a = Convert.ToInt32(mycomm.ExecuteScalar());
if(a.ToString() == null)
{
MessageBox.Show("no Res id found");
}
else{
MessageBox.Show(a.ToString());
}
can someboddy help me ? thanx
|
|
|
|
|
Why didn't you post the error message, don't you think that would be the quickest way to fix the problem?
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
I have a couple of thoughts here - the first being that you shouldn't use commandtext here. Use a Stored Procedure so that you don't end up opening your app up to s SQL Injection attack. Secondly, if you are going to return a Scalar, use
SELECT (COUNT(1)) FROM AfwTarieven WHERE Res_nr = @Res_Nr in your stored procedure. If it returns 0, then it isn't present - anything else and it is.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete Oihanlon,
Thank u , great help
|
|
|
|