|
Thanks for the reply. I'll take a look!
--------------------------------
"All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke
|
|
|
|
|
I have a program that is semitransparent and is topmost. If a different program has focus, the keyboard messages reach it (the other program) just fine, but my topmost form intercepts mouse input (understandably so). How can I make my program take all mouse input and resend it through Windows's message pool so that it's as if my program wasn't there? I want to be able to function in the other active applications as if my program wasn't there (wasn't topmost).
The reason it has to be topmost is because it has a duplicate of the user's background image on it. Being semitransparent, it gives the effect that, instead, all of the other programs are semitransparent (the ultimate goal), so that the user can still faintly see their wallpaper "behind" their programs (because I don't know how to forcefully reduce all other programs' opacity).
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
My shameless plug[^] on click-through forms.
You can't force another app's window to be opaque. You have no control over how another app paints it's windows. On top of that, what you have to do to the window to support opacity could very well make the other app's painting code crash.
|
|
|
|
|
I understand that I can't alter how another window paints itself. That's why I needed a click-through-able window.
Your shameless plug is exactly what I needed! (well... after manually converting the VB to C#) However, it wasn't working exactly 100%. I took out the lines that changed [myform].Opacity and it seems to be working just fine now (using SetLayeredWindowAttributes instead of Form.Opacity).
Thank you!
I now have a wallpaper that seems to "show through" all of my windows (as if all of my windows were semitransparent)!
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Hello everyone,
I have a DataGridView controll which is populated by a table from a remote database. One of the Columns contains images which I am using the following line of code to access the images in the DataGridView.
System.Drawing.Image itemOriginalImage = (Image)dataGridView1.Rows[ItemRowIndex0].Cells["item_image"].FormattedValue;<br />
I wish to remove the DataGridView and replace it with a DataTable. I was wondering how I can access the image column in the DataTable?
I am using this code but I am unable to set the format right.
System.Drawing.Image itemOriginalImage = (Image)myTable.Rows[ItemRowIndex0].ItemArray.GetValue(6).<br />
I get the following error for the above line of code. "Unable to cast object of type 'System.Byte[]' to type 'System.Drawing.Image'."
Can someone be kind enough to tell me how I can access the image in my DataTable?
Thank you very much and have a great day.
Khoramdin
|
|
|
|
|
Use
System.Drawing.Image _image = System.Drawing.Image.FromStream( new System.IO.MemoryStream( (byte[])myTable.Rows[ItemRowIndex0].ItemArray.GetValue(6)) );
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
I have a string strA = "12 MyAddress"
strB = "Your Name"
I want to get the first char of string and want to know weather it is integer between 1-9 or char between A-B.
How can I do that.
seema
|
|
|
|
|
The string class provides a handy little Substring function. You can cast it to a char, and the char class provides functions like IsDigit to help. Have a look at the documentation for these classes to get a clear idea of exactly what you need to do.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
char c = strA[0];
if (c >= '1' && c <= '9') {
} else if (c >= 'A' && c <= 'B') {
}
|
|
|
|
|
In C# or VB.NET ? Please don't crosspost.
You can do this:
if (Char.IsDigit(strA[0]) || strA[0] == 'A' || strA[0] == 'B')
{
}
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Since you have cross-posted in three forums you are being sent to the corner where I will whip you virtually with my Wired magazine until you beg for forgiveness.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
hi
I got a problem in inserting new rows to a datatable.How can I insert dates in a data table using DB2.
Here is some code...
DB2Connection conn = new DB2Connection(connectionString);
DB2DataAdapter DataAd= new DB2DataAdapter(select, conn);
DataSet ds=new DataSet();
DataAd.Fill(ds, "Table Name");
Datarow dr = ds.Tables["Table Name"].NewRow();
DB2Command aCommand = new DB2Command(select, conn);
aCommand.CommandType = CommandType.Text;
aCommand = new DB2Command("INSERT INTO CL.VSCHTM("ST_DTE")"
"VALUES ("#" + dr["ST_DTE"]+"#",conn);
DataAd.InsertCommand = aCommand;
DataAd.Update(ds, "Table Name");
aCommand.Parameters.Add(new DB2Parameter("ST_DTE",DB2Type.Date, 0, "ST_DTE"));
aCommand.UpdatedRowSource = UpdateRowSource.OutputParameters;
It doesn't add new row ,any help??
kidus
|
|
|
|
|
Is the datetime the min value in .net? There is a chance that db2 doesn't support it. I know sql server does not. I would think if the row doesn't get inserted there must be an error message. Have you tried to do the insert outside of .net to see if it works?
Ben
|
|
|
|
|
I trying to interact with a Microsoft Access Database in an application. Interactions include creating, deleting, and editing entries.
In Visual C# Studio, I have created a connection to the database, but I can't figure out what to do from there. Is there a way to cycle through the rows and columns in a database table using a for or foreach loop? I'm thinking it has something to do with the DataSet and other associated classes.
If I had a sig, it would probably go here.
|
|
|
|
|
Well, you can extract rows into a dataset and then use a foreach on the DataRows. For instance:
foreach (DataRow dr in dsDataset.Tables[0])
{
} Alternatively, you can pull the data out with a DataReader and loop through them using:
while (dr.MoveNext())
{
} Note that this is sometimes called a firehose cursor (something you may want to google).
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
That's what I was thinking, but how do I extract rows into a dataset?
If I had a sig, it would probably go here.
|
|
|
|
|
Well, one way to do this is:
DataSet ds ;
using (OleDbConnection conn = new OleDbConnection("myConnectionDetails"))
{
using (OleDbDataAdapter cmd = new OleDbDataAdapter ("myCommand", conn))
{
conn.Open();
try
{
cmd.Fill(ds);
cmd.Close();
}
finally
{
if (conn.State == ConnectionState.Open)
conn.Close();
}
}
}
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks, I'll try that!
Hippophobia- Fear of horses. What... What?
|
|
|
|
|
And is there a way to put the data from the DataSet back into the database?
Hippophobia- Fear of horses. What... What?
|
|
|
|
|
I recommend buying a book on ADO.NET, and perhaps one on SQL ( from the sounds of it )
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi .I have following problem with DataGridView. I use DataGridView bound to collection of objects. One of the properties is of boolean type. It is bound to CheckBoxColumn. I would like to display number of rows that are checked immediately after user checks one of the rows. Unfortunately value is pushed to underlying source only after user leaves edited cell. Is there any way how to find how many rows is checked right after box is clicked.
|
|
|
|
|
does anyone know how to loop through a binding source?
so far i have been working with the code
foreach (DataRowView invoiceRow in invoicebindingsource)
{
}
but what if i only want to check one column? I am also a little unclear on how to address that info in the cell i am currently looking at
Thanks for any help you can give
|
|
|
|
|
crash893 wrote:cell i am currently looking at
what does "looking at" mean?
|
|
|
|
|
test or manipulate
messagebox.show(something.tostring())
i am also trying to figure out how to do something like
if something.tostring() containes stringtext
{
replace something.tostring with stringreplace
}
|
|
|
|
|
crash893 wrote: test or manipulate
so if replace "looking at" in your first post with "test or manipulate".....
crash893 wrote: I am also a little unclear on how to address that info in the cell i am currently testing
I struggle to understand your posts. All I can do is guess that you are asking how to access the "columns" in the DataRowView . I really hope this is a school project. Anyway, I recommend you "read" some documentation on DataRowView from the MSDN Library which is available online from Microsoft. Also there are many MANY articles here on CodeProject that contain sample code for working with Database related issues. I would bet some of them show how to access columns of a DataRowView.
|
|
|
|