|
hi Sean89!
if you're customizing or inheriting a textbox, you can override the OnClick Event handler of it.
like this:
public class MyTextBox : TextBox
{
public MyTextBox()
{
}
protected override OnClick(EventArgs e)
{
this.Clear();
}
}
hope that helps!
microsoc
|
|
|
|
|
|
Hello,
I have a statement: Table.Select("Date = "+anObj.ToString());
However, the anObj is a date string, and is in the following format: 01/01/2006 12:00:00 A.M.
So I get an exception every time it gets to the above line: Missing operand after '12' operator.
Any idea how to fix that?
Thank you.
|
|
|
|
|
I think you can use a .ToShortDateString() instead of the .ToString()
Steve Maier, MCSD MCAD
|
|
|
|
|
Yes, I tried that. Unfortunatelly, object only has toString attribute, since it's not an official DateTime object, even with the cast.
Thank you.
|
|
|
|
|
try using
Table.Select("Date = '" + anObj.ToString() + "'");
|
|
|
|
|
hello!
i have an C# Application that works with MS Access through OledbConnection.
the security i have is just the password on the DB. The user knows the path to the DB. it is on the server. how can i prevent him to from copying the DB file?
thank u.
Andrew
|
|
|
|
|
From your code, you can't. In order for your app to work, the user running it needs both Read and Write access to the folder where the database .MDB file is. To copy the file, the user just needs Read access to it. Not even NTFS security will prevent someone from copying the file while your app still needs access to it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hello!
could u please help me to define the print area if i work in C#.net 2003, w
ith a word document? i just need to place some text exactly in the point on
the sheet (i know its coordinates, 10 cm from top, 7 cm from left side), so
i need to know how much the printing area is.
thank u!
Andrew
|
|
|
|
|
Hi every body
I want to know how i can use visual studio query builder in my programs. There is a form called QueryBuilderDialog in Microsoft.VSDesigner. This form has a constructor with this parameters
System.IServiceProvider serviceProvider
System.String provider
System.String connectionString
System.String encryptedData
System.String sqlText
Microsoft.VSDesigner.Interop.DSDFlags flags
I dont know how to use this form .
If any body knows about this querybuilder please help me.
thank you
Farshid
|
|
|
|
|
|
On the client side? You can't. The client machine is off limits to code running inside a browser session. ASP.NET apps don't have any access to the client machine at all.
On the server side, you can just use the Process class. Although, running an .EXE from a web request isn't a good idea.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I need to run one exe file from web application and what u suggest me?
is any better way to run exe file from webapp.?
|
|
|
|
|
FlushCode wrote: is any better way to run exe file from webapp.?
No, he gave you the solution.
... now you see that evil will always triumph, because good is dumb. - Dark Helmet
|
|
|
|
|
Better way??? You weren't listening were you? There is NO way.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Well, he *could* use an ActiveX control (ugh) if he wants to run software on the client end. Also, you can use .NET assemblies embedded inside web pages as well, however, thanks to .NET's Code Access Security, he wouldn't be able to launch some arbitrary application.
|
|
|
|
|
Judah Himango wrote: thanks to .NET's Code Access Security, he wouldn't be able to launch some arbitrary application.
Yep!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I am writing an application that solves sudoku puzzles (you can learn sudoku at www.websudoku.com if you dont already know it). Although it works, there are a couple of things I would like to do and dont know how to.
1. I have 81 text boxes for each cell in the 9x9 puzzle. SharpDevelop (www.icsharpcode.com) generated constructer code for each one (2000 lines!) Is there any way, since the code is mostly identical for all of them, I can define them all at once, in a loop? It would save a lot of space, and make the code neater.
this.cell32.BackColor = System.Drawing.Color.PaleGreen;<br />
this.cell32.DetectUrls = false;<br />
this.cell32.Font = new System.Drawing.Font("Courier New", 6.65F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));<br />
this.cell32.Location = new System.Drawing.Point(44, 128);<br />
this.cell32.MaxLength = 1;<br />
this.cell32.Name = "cell32";<br />
this.cell32.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;<br />
this.cell32.Size = new System.Drawing.Size(40, 40);<br />
this.cell32.TabIndex = 29;<br />
this.cell32.Text = " 1 2 3\n 4 5 6\n 7 8 9";<br />
this.cell32.WordWrap = false;<br />
this.cell32.Leave += new System.EventHandler(this.CellLeave);<br />
this.cell32.TextChanged += new System.EventHandler(this.CellTextChanged);<br />
this.cell32.Enter += new System.EventHandler(this.CellEnter);
Obviously, the cells' Names are different, as are their Locations, and their TabIndexs
2. This is probably a stupid question. Every time I run the program, the command line appears. This does not need to happen, right? Why does it, and how can I make it not happen? I've made other apps which dont do it.
You can get the app and the source (if youre really that interested) at...
http://wilmington-web.net/sudoku/
Thanks for all your (prompt) help.
I have gone to find myself. If I come back before I return, please keep me here.
|
|
|
|
|
couldn't you do something like (just pseudocode)
int i = 1;
foreach(control in this.controls)
{
if(ctl.GetType() == "textbox")
{
ctl.Name = "cell"+i.ToString();
ctl.TabIndex = i;
i++;
}
}
BugReporter[^]
BlackDice
|
|
|
|
|
#coder05 wrote: I can define them all at once, in a loop?
Yes, you can create and add textboxes just like any .NET object. You can write it like
class SudokuForm : Form
{
TextBox[] textBoxArray = new TextBox[81];
public SudokuForm()
{
for (int i = 0; i<textBoxArray.Length; ++i)
{
textBoxArray[i] = new TextBox;
textBoxArray[i].Name = "cell" + i.ToString();
textBoxArray[i].Location = ...
}
}
}
The toughest part is calculating the location. If each textbox's size is fixed, you can simply use the loop index to calculate the offset from the top left corner of the form to determine the location.
#coder05 wrote: Every time I run the program, the command line appears.
Looks like your project is setup to generate a command line app. I've never used SharpDevelop, but from this[^] page (fourth picture from the top), try looking for a winexe option(or something similar) in the "Compile Target" combobox.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks (I was stupid but next time ill be able to do it) a lot
Amazingly fast help here!
I really appreciate it.
bigiorno
|
|
|
|
|
Hi all,
Just registered today for CodeProject.
I do have a question:
Today at school, a fellow student learned me how to add things to the toolbox, like Windows Media Player.
Put that to my form.
But, I also want a Quicktime player to add to my form.
I searched in the COM compounds, and found "Quicktime Object", I do put it in my form, but what next?
WMP showed standard an play stop etc button (in the window itself, thus not the form), but Quicktime doesn't have that.
So what do I need to do to run an Quicktime file?
And I also want a message to appear when successfully saved (a file) on the system.
Like: (filename)successfully stored at (location (yes I know to do that by typing: @ .... )) , but ONLY after and if the file is saved.
So an short summary of my questions:
* How do I play files with the Quicktime plugin?
* How do I make a message appear when a file is saved successfully?
Well hope to get an answer soon :->.
Greetz
ChevyVanDude G30
|
|
|
|
|
...goes to me.
I accidentally Shift/Del eted my form's .resx file. Is there any way to recreate it or am I doomed to rebuild my intricate form my hand?
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
- Delete the
.resx file from the Solution Explorer.
- Close and re-open the project.
- View the form in the Designer.
- Add a control to the form - this regens the
.resx file.
- Rebuild the project.
- Remember to perform bootstrap caffeination before writing code.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Usually, VS.net is smart enough to recognize that the class is of type form/control and it regenerates the RESX file. In the past, I've been able to import the form (just the .CS file only) by adding it to the project. You may want to exclude the file and reinclude it. Press Shift+F7 (and not Shift+delete ) on the CS file to switch to designer!
- Malhar
|
|
|
|