|
I am not able to attach Application.Idle event with the event handler. what will be the reasons??
thanks
|
|
|
|
|
saksp wrote: what will be the reasons
Maybe you're doing it wrong?
This works for me.
using System;
using System.Windows.Forms;
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Application.Idle += new EventHandler(Application_Idle);
}
void Application_Idle(object sender, EventArgs e)
{
}
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
saksp wrote: I am not able to attach Application.Idle event with the event handler. what will be the reasons??
You're doing it wrong.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi all,
On VS2005, I've add a background image on a form, fine. But when I added a label cannot see the image through it. How can I see the image through the label?
Thanks a lot.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Make the background color of the label transparent ? The other way is to draw the text on the form yourself.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
CodingLover wrote: How can I see the image through the label?
set the Backcolor for the label to: Transparent
label.Backcolor = Transparent
|
|
|
|
|
You set the label to transparent, However be aware that there is no true transparency in .net which means that transparent shows the background image and not the image underneathe.
|
|
|
|
|
I am using AxWebBrowser control on windows form. I want to handle the shortcut paste(ctrl + V) event so that i can excute my own customised function to perform this operation.
I tried this as following:
private void editorWebBrowser_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyData == (Keys)Shortcut.CtrlV)
{
MyTextPasteFunction();
}
base.OnPreviewKeyDown(e);
}
But it is not stopping executing it's default paste event. So Ctrl + V is pasting the contents twice.
What should i do to stop the default paste event execution?
Thanks in Advance.
|
|
|
|
|
You could always inject an onpaste handler in the webpage immediately after it has been loaded.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
To elaborate further ,i am working on Content management system and I have embedded the AxWebBrowserControl on Windows form.
|
|
|
|
|
When the web page has finished loading, you could inject some javascript into the page that handled the onpaste function.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
I am working on content management system and the axwerbbrowser is nothing but HTML editor control
|
|
|
|
|
So, create a minimal webpage with the onpaste function already in it.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
I am doing an update to my database after adding a row to the data table. The TableAdapter uses the VS2005 generated INSERT command (the table has a lot of columns). The line is...
DishVarTA.Update(CurrentStDishVarRow);
where 'CurrentStDishVarRow' points to the row in the 'Added' state.
My problem is that I want to use the row data after this statement to format and send off to some machinery. After the Update however 'CurrentStDishVarRow' points to an entirely different row.
I think the INSERT statement in the TableAdapter is putting the new row in at the beginning of the table so the row indexing changes.
Is there any way I could preserve the pointer, or is the only way to fill the table again and/or find it again?
Done a lot of searching and haven't found much that covers this, does that mean preserving row pointers across updates is not 'de rigeur'?
Thanks,
|
|
|
|
|
jrgrobinson wrote: DishVarTA.Update(CurrentStDishVarRow);
This code will attempts to save changes in the indicated DataRow to the database.
You can store the row before updating and then manipulate the new instance of required row.
now to locate the row in the datatable before calling the update method for the dataadapter use one of this methods:
<br />
string s = "primaryKeyValue";<br />
DataRow foundRow = datatable.Rows.Find(s);
<br />
DataRow[] foundRows;<br />
foundRows = datatable.Select("put filter expression ");
|
|
|
|
|
Thanks. Just a simple question, after the update, could I assume the rows are all still in the TableAdapter and do the Find or Select then?
Thanks
|
|
|
|
|
TableAdapter don't store any rows, it just provide communication between your application and a database.
try to read this article to get more info:http://msdn.microsoft.com/en-us/library/bz9tthwx(VS.80).aspx[^]
The Datatable represents one table of data, so you should depend on the datatable to use the find or select methods.
Like what you do if you can't do what you like
|
|
|
|
|
You are using the built in wizard thingys to do your data processing and now you want to do something slightly different to the STANDARD methedology, like post processing after an insert. This is why they are a POS, I strongly suggest you read up on Data Access Layer and rework all your data processing.
As that is probably going to frighten the day lights out of you (as it would most people) try and capture the row information prior to saving back to the database (take a copy/clone of CurrentStDishVarRow ) and see if you can work with that.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I guess this is the problem with the 'standard methodology'. It is kinda hard comining into it to understand the conventions. There certainly isn't a lot except experience that would tell you an update rearranges the cache. A view from other worlds would be that a data cache wouldn't change after a write to the source, thus preserving some independance between the user and source.
Been doing a lot of reading and SQLCommands are looking attractive, but copying across the database update will get my machines working tomorrow.
Thanks for taking the time to respond.
|
|
|
|
|
Just to close it off for prosperity.
I have a data table, filled by a table adapter with '...WHERE(PK=@PK)'. It had a single row in it. I added another row (.NewRow, .AddRow). The Rows count of the table was 2. Index [0] pointed to the old origional data. Index [1] pointed to the new data, DataRowState=Added.
I then called the table adapter.update (a rather large INSERT statement)
There was still a count of two rows but both [0] and [1] pointed to the same row, the origional. This would indicate the data table of the dataset is no longer valid after an Update. I then did another fill and the data table had both rows as before (now unchanged state).
The reason for writing this is to record for other people that may fall into this minor but time consuming trap. The tableAdapter.Update call is the end of the road for the validity of the data table data. There isn't a lot of documentation or web resource that tells you this.
It maybe obvious to seasoned .NET database engineers, and maybe standard practice. It would be unexpected to new entrants in this field with experience of other, dare I say it, more normal, caching systems.
Thanks for the help.
Ooops, I modified Table Adapter to refer more correctly to the data table of the dataset where referring to storage.
|
|
|
|
|
I want to know how to make my application autorun I mean how to put it in the system startup. I want when the windows starts my main form get minimized and instead of taskbar I want to show its icon in the notification area.
Also, I need to know how can I realize when my form restores after minimizing.
I really need to know the answer as soon as possible
|
|
|
|
|
|
saeidfarahi wrote: I really need to know the answer as soon as possible
Man you should be a comedian... you seem to have a beeter angle on that then programming!
However ... TO answer your first question just put a shortcut to your application in the startup folder on windows....
Not sure on the other answer....
|
|
|
|
|
in my application i need to create our own spell checker...
actually wht i am doing is in my form i have some control like buttons,label like..when i click on spell check i need to check the all the controls Text..
so i need to create own spell check Designer..
please any one help me.......
Thanks
|
|
|
|
|
Do you honestly think that a forum reply will teach you how to write a spell checker ? Buy one, use Word, or give up.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|