|
I have a wacom graphics tablet / pen pad. Is there a way to capture the signature with c#? Thanks.
|
|
|
|
|
There's always a way, but how it's done should be covered in the SDK for the pad. There's nothing in the .NET BCL that's going to "do it for you". I have no idea how it's going to be done, but it would depend on how the PC talks to the pad, be it Serial Port or network or USB.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Windows Presentation Foundation (WPF) has a number of APIs for receiving input from a stylus. Check out InkCanvas[^].
|
|
|
|
|
I was thinking it was something like a credit card signature pad! :->
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I have been developing for a while now, mostly in VB. But now I have seen the light and joined the C# parade.
Anywho, is there a difference between the functions and use of string. functions and String. functions? I use .Empty , .IsNullOrEmpty , and .Format all the time. Does it really matter if I use string. or String. ? I know that one is a type, but besides the color in VS, what is the difference, and should I use one or the other?
Success is the happy feeling you get between the time you do something and the time you tell a woman what you did.
--Dibert
|
|
|
|
|
string is a C# keyword that is an alias to System.String.
If you have "using System;" in your file and you don't have any other class named String, then String (the class) and string (the C# keyword) are equivalent. Otherwise String may refer to your own String class, while string always refers to the built-in string class.
Another difference: you may use String as a name for local variables (if you like to confuse people reading your code), but string is reserved.
But normally using string or String makes no difference, both compile to the same IL.
|
|
|
|
|
I've always been told to always use the lower case as it makes it easier to read on others who are viewing your code (unless they come from jave)! Also, you should learn all about string builders. They are the best item for creating multi component strings and they only are created once, not every time you add another string element.
Sorry for the diatribe.
_____________________________________________________________________
Our developers never release
code. Rather, it tends to escape, pillaging the countryside all around.
The Enlightenment Project (paraphrased comment)
Visit Me at GISDevCafe
|
|
|
|
|
I would not recommend writing your own String class; too confusing !
|
|
|
|
|
There really isn't any difference. string is the C# alias for System.String , which is the actual CLR data type.
I personally use string when declaring variables and String when calling functions (like .Empty , .IsNullOrEmpty , and .Format ) as I think it makes it a little clearer; but that is simply personal preference and string.Format is exactly the same as String.Format .
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
String may refer to your own class, string refers to the inbuilt string class
Keshav Kamat
India
|
|
|
|
|
Hi Guys -
I am having problems dragging and dropping controls on my forms in VS2005. Nothing is locked and I am able to move them if I go into the properties window and manually change their position...but it won't allow me to grab them and move them around
|
|
|
|
|
This is just a guess, but is your app running. If you app is running I think it locks the from even through you can still see it.
Ben
|
|
|
|
|
Hi.
When the new webbrowser in .NETCF 2.0 is loading, a progress bar is displayed at the base of the control.
Does anyone know how to stop this from appearing?
I'm only using the control as a HTML viewer, so I really don't want to see the progress bar everytime I send new information to the page.
Thanks.
|
|
|
|
|
Hi
I have an ActiveX control which behaves well outside of the .NET environment. However when i used it via interop i can't seem to set the backcolor and forecolor properties.
Anyone any ideas?
Cheers
|
|
|
|
|
AX controls don't always respond to .NET standards, such as having Fore and Back colors. This is probably settable only if the Ax control provides some means of of setting those explicitly outside the normal properties.
|
|
|
|
|
Yeah, its quite strange the ActiveX Control supports BackColor and ForeColor. When they come through COM Interop - the AxInterop file exposes them as .NET Color type. The standard interop files gives an interface with them as UINT.
Neither of which work! Very frustrating considering the control works fine ouside of .NET.
|
|
|
|
|
I'm sure there's a way to get this to work. What is the method/property that COM really exposes to set the back color? (e.g. not the one .NET is showing you)
|
|
|
|
|
I agree...
It looks like interop is not calling through to the old property on the control.
But i am at a loss... Managed to cast it back to the original interface that exposed the backcolor as uint. Bu that didn't help.
|
|
|
|
|
AJ123 wrote: Managed to cast it back to the original interface that exposed the backcolor as uint.
So setting the uint didn't work?
|
|
|
|
|
Hi all,
I launch a windows application from another windows application in .net.It is launched as a process by clicking a button.
When i click the button multiple times without gap atleast 2 times or more, i need to ignore the subsequent clicks till the application is loaded completely.
How do i do this?
Thanks.
|
|
|
|
|
One way to do this is create a private variable. Set this with the first click and then re-set it later. The code would be something like this:
private bool processing;
if (!processing)
{
try
{
processing = true;
}
finally
{
processing = false;
}
}
Hope that helps.
Ben
|
|
|
|
|
Why not disable the button till you want to accept subsequent clicks.
|
|
|
|
|
Im trying to update the content in the database but it doesnt work i dont understand why.
I commented most of the code tell me if something is unclear
Get content code:
//if creating new file use textbox1 rather then the double clicked data cell
string fns = "";
if (open == false)
{
dataGridView1.CurrentCell = this.dataGridView1[0, e.RowIndex];
fns = dataGridView1.CurrentCell.Value.ToString();
}
else
{
//use filename box (file creation)
fns = textBox1.Text;
}
// get content where name == fns
SqlConnection sql = new SqlConnection(sqlcon);
a = new SqlDataAdapter("SELECT [Content], [primkey], [Name] FROM Keeper WHERE [Name] ='" + fns + "'", sqlcon);
try
{
a.Fill(s, "Keeper");
foreach (DataRow dr in s.Tables[0].Rows)
{
dataGridView2.DataSource = s;
dataGridView2.DataMember = "Keeper";
}
//get content from datagrid insert into richtextbox
dataGridView2.CurrentCell = this.dataGridView2[0, 0];
richTextBox1.Text = dataGridView2.CurrentCell.Value.ToString();
}
catch (SqlException sqlexcp)
{
MessageBox.Show(sqlexcp.Message.ToString());
}
//close connection, reset bool, bring up editor
sql.Close();
open = false;
richTextBox1.BringToFront();
Save content:
//get content from textbox insert into datagrid
dataGridView2.CurrentCell = this.dataGridView2[0, 0];
dataGridView2.CurrentCell.Value = richTextBox1.Text;
//update DB
SqlCommandBuilder mySqlCommandBuilder = new SqlCommandBuilder(a);
a.Update(s, "Keeper");
|
|
|
|
|
try to use sql interogation
i am not sure but i think you update only one dataset not the dataBase
|
|
|
|
|
So how would i update the database?
|
|
|
|