|
For a system (similar to a Windows Service) I wrote a while back I had to write an editor for its configuration. The editor had to alert the running process of any saved changed. I didn't want false-positives (e.g. changing a value from 2 to 3 and back to 2), so as to avoid interupting the process needlessly. It wasn't much data so I had it save a copy of the data it read in. At exit it compared the two copies and only saved and alerted if there were actual changes.
I realize this may not apply to your current situation, but maybe it'll help someone else someday.
|
|
|
|
|
Great suggestions you've had.
This[^] is one way of implementing it that I've come across. It's old code, and some of what it uses is marked as obselete, but may be a starting point.
It would be very useful if System.Windows.Forms.Control had an IsDirty read only property and an IsDirtyChanced event, then it would cascade through to every control we use, and would automatically be there in any new controls we create.
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) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
|
You don't need an event handler for each field in the form. Just point the Changed event of every relevant control to the same event handler.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Sounds good, but I think I have radio buttons, check boxes, numeric updowns and textboxes, I can only use the same handler if they all use normal EventArgs.
|
|
|
|
|
|
How can I Move ScrollBar in ListView From left to Right when I set "RightToLeft"property true?
|
|
|
|
|
I think you need to just set Scrollable=True only. RightToLet Property is used for "Gets or sets a value indicating whether listviews elements are aligned for right-to-left fonts"
Please Read the MSDN Documents on Same.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hey all,
Hope you are all doing well. I have a question that I just can't seem to find a good answer to. I am trying to use WIA to scan multiple documents without user interaction. I found out how to call the camera and scanner wizard to acquire images from the scanner and it does allow for document feed.
So this all works well and good. The only problem is that my application needs to know where they selected the files to go so that I can send them to the database when they are done. I just can't figure out how to get that location from the wizard. Can someone please lead me in the right direction here, or at least tell me if this is possible with the ShowAcquisitionWizard method?
Thanks for any help in advance.
Justin | CodeBase25
"Instant programmer, just add coffee"
|
|
|
|
|
Hi,
I have a bound datagridview which contains three combobox columns. The items in each combobox is databound also but dynamically. Depending on the value of the first combobox, the second and thrid combobox will be bound accordingly. I subscribe to the cellendedit event where I check if the cell is in the first column and then databind the second and third combobox cells accordingly. This works fine. The only problem I have is that when the datagrid view is loaded, as it is databound it is trying to assign the second and third cells of each row values which is not in their respective combobox list as the combobox is not bound. Is there any event available in the datagridview control which will let me check the value just before it is being bound to the datagridview cell. There I can bind the comboboxes before the value get's assigned and I shouldn't get any problems. I tried using the databinding complete but that didn't work.. Any suggestions?
Thanks
|
|
|
|
|
There is an event named as "Selected Index Changed " used for combo boxes. You should go for that. If that doesn't even solve your problem then contact me again.
|
|
|
|
|
There is no Selected Index Changed event for the datagridview combobox. Are there any events that occur while databinding is happening?
|
|
|
|
|
|
hi..all please give some suggestions if you have on this...
|
|
|
|
|
To enable clearing your points simply add a call to Invalidate() to the end of your button2_Click() event handler.
private void button2_Click(object sender, EventArgs e)
{
points.Clear();
this.Invalidate();
}
Whilst on the subject of painting, for what you are trying to to do you do not need to override the OnPaint() method, simply handle the Paint event of your form.
As far as moving the points is concerned the procedure will be the same as moving any drawing object.
1) Handle the MouseDown event, in it decide if the mouse location (e.Location) is at a point of interest. If so, make a note of the point1 and then set a boolean flag to true (call the flag something like 'moving' so that its name reminds you of what it's for, and take a note of the current position of the mouse in a class scope field (it will be needed in several places), of type Point , something like this.moveStartPoint = e.Location .
2) Handle the MouseUp event, in it set the flag ('moving') to false, and the moveStartPoint to null and call this.Invalidate()
3) Handle the MouseMove event, in it first check that 'moving' is true (this means that the mouse is still down). If not return . If it is true then set the point that you made a note of in 1)1 to the new location of the mouse. As you are only moving a point you can set it directly but if you were moving a 'shape' fro example, you would have to use something like
storedPoint.X += (e.X - this.moveStartPoint.X);
Take a look at this[^], for a complete example of moving things you have drawn.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi,
How to handle ToolStrip's Overflow button click event?
Thanks
|
|
|
|
|
OK, i found a way...
there is an event called Overflowbutton.click., we have to include this delegate and handle it explicitly
|
|
|
|
|
Hi there,
I am currently developing a CAN-Monitor (Controller Area Network). The messages
are received event-driven. At the moment the display of the messages is done by a ListView.
In the near future the number of received messages will grow up to ~ 600-800 messages per second.
The messages (encapsulated in a specific object) are delivered to the view via event to a event-handler-method.
Is there a alternative to the ListView which is more performant than the standard-one?
Thanx in advance!
|
|
|
|
|
The ListBox , but whatever control you use, as a user I can't read 600/800 messages per second. What's in the message that it needs to be displayed? If there's no specific information, I'd show a label saying (done msg x of y), and only show those who are "interesting" enough.
|
|
|
|
|
Even if there was such a control, how would a person make sense of a list that was constantly adding messages at an average rate of 700/sec? That sounds like the definition of information overload to me; I'd be more concerned with reducing the amount of information inserted into the list rather than finding a better list control.
|
|
|
|
|
If you absolutely must have a ListView with all of these messages, consider looking into the ListView's virtual mode. It might suit your task a little better.
That solution aside, could you look into using a different user experience that's a little more streamlined for your data?
Adam Maras | Software Developer
Microsoft Certified Professional Developer
|
|
|
|
|
Hi,
I've created a new user control.
I want to add the property "SelectionColor" to it (like in RichTextBox),
and then i wantto implement the functionality for the property.
Someone have an idea how to do it?
Thanks
modified on Saturday, July 25, 2009 9:22 AM
|
|
|
|
|
What is it that you are not sure of?
How to add a property, or how to implement the functionality for the property once it is added?
DO NOT reply to this post, edit your original to make this clear!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
you should write code like this code in user control
this code use for datagridview "RowHeaderVisible" property
public bool RowHeaderVisibl
{
get
{
return rowHeaderVisiblee;
}//get
set
{
rowHeaderVisiblee = value;
dataGridView1.RowHeadersVisible = rowHeaderVisiblee;
}//set
}//RowHeaderVisibl
|
|
|
|
|
I want to create a c# win form app. It should just display a message box, whenever I am opening Iexplorer.exe. How to do this friends?
|
|
|
|