What do I want to achieve: I want to perform some time consuming operations from my MDI winforms application (C# - .NET).
An MDI child form may create the thread with the operation, which may take long time (from 0.1 seconds, to even half hour) to complete. In the meantime I want the UI to respond to user actions, including manipulatio...
Demands / problems:
I would like to bind multiple properties of an entity to controls in a form. Some of which are read only from time to time (according to business logic). - Edit: The logic is based on the bound instance, not only on its the type.
When using an entity that implements INotifyPropertyChanged as the DataSource, every ch...
I have a image (png file) with opacity 35%, i want for example:
Set the opacity image to a panel BackgroundImage, the panel is over a form with backcolor black, i thought (like in photoshop happen) that the opacity of the image will do a more clear color in the panel area, but the real result is that panel appear entire white, someone k...
Suppose my WinForms application has a business entity Order, the entity is used in multiple views, each view handles a different domain or use-case in the application. As an example, one managing orders, the other one digging into one order and displaying additional data.
If I'd use nHibernate (or any other ORM) and use one session/data...
How can I get ContextMenu that a ToolStripDropDownItem belongs to? This is for the purpose of using the ContextMenu.SourceControl as the logical sender to an event.
...
I've been working on developing a middle man application of sorts, which uploads text to a CMS backend using HTTP post requests for a series of dates (usually 7 at a time). I am using HttpWebRequest to accomplish this. It seems to work fine for the first date, but when it starts the second date I get the System.Net.WebException: The requ...
I have a C# app, and I'm looking at using the Windows Media Player COM control to play animation and audio. So far, the only way I see of programatically controlling what the control is playing is to set its URL property to point to some file (I assume there's some way to pass in a playlist).
Is there any way the WMP can render an AVI ...
In IE8, I get the follow warning, but if I choose to continue the site displays properly.
There is a problem with this website's security certificate.
The security certificate presented by this website was issued for a different website's address.
Security certificate problems may indicate an attempt to fool you or intercept any ...
I want to add a new method in Windows.Forms.Form class..
Please help how to do this if anyone knows..
...
Hi,
I have a DataGridView that is bound to a list of object. It has some columns that the user can edit. There are certain inputs that are not allowed for a row as a whole. How can I roll back if the user enters invalid inputs in some cell.
I tried using the RowValidating event handler but it was not called after cell value has been ch...
I have a binding source object that fills some textboxes.
In run time, after editing the textboxes I want to be able to retrieve the old values.
how can I retrieve the Textbox's old value and refresh the screen ?
Maybe the binding source has history or something ?!
...
The Scene: A (smallish) Form hosting a UserControl.
The Plot: Whenever UserControl raises a hover event, display some (graphical) information in a tool tip fashion. When the user moves the mouse, fade them away again.
Notes: I'd like to display more than one "tooltip", with each tooltip being a UserControl displaying information in a g...
I've been converting all kinds of other things, classes, interfaces, ASP.NET MVC apps, and WPF applications, but I am stumped as to how to convert a windows forms application, as the whole structure seems to be different. Does anyone have any advice on how to tackle this problem?
I see essentially that you have two files, Form1.cs and F...
Hi, could you please help me with this one? I'm trying to capture Tab key in Windows Forms application and do a custom action on it.
I have a Form with several listViews and buttons, I've set Form's KeyPreview property to true and when I press any other key than tab, my KeyDown event handler does get called.
But that's not true with the...
I have a DataGridView which is filling from Table in SQL Server Database. One of it's columns is "price".
Type of column in DGV is automatically sets as Decimal.
In some cases I need to write in cells of this column text like "none", instead of price.
How can I do it?
DGV.Item("price", 0).Value = "none"
doesn't work, because of dec...
I break the code of the for loop without using break like I have for loop given below.And when i is 1 or 2 or 3 or any else but if condition is true then loop will be terminated because i will be 5 if the condition is true.And so NO need of break is needed there.Beacause I do not want to use break.I have done like this here.It works.
in...
I've been using ShowDialog() in following way for all my new Windows.
SomeGui test = new SomeGui();
test.ShowDialog();
refreshSomeListView();
However recently I've started to use Show() instead of ShowDialog() and it's working much better. The only drawback of this is that refreshSomeListView(); cannot be used like in example above s...
I haven't done much multithreading before and now find the need to do some background work and keep the UI responsive. I have the following code.
data.ImportProgressChanged += new
DataAccess.ImportDelegate(data_ImportProgressChanged);
Thread importThread = new Thread(
new ThreadStart(data.ImportPeopleFromFAD));
importThre...
I have a datatable that contains rows of transaction data for multiple users. Each row includes UserID and UserTransactionID columns. What would I use for as a RowFilter in the tables DefaultView to only show the row for each user that has the highest UserTransactionID value?
sample data and results
UserID UserTransactionID PassesFi...
Hello, I have a simple file browser and there I display files and folders,
obtained by (for directory)
SHFILEINFO info = new SHFILEINFO();
SHGetFileInfo(filename,
FILE_ATTRIBUTE_DIRECTORY,
ref info,Marshal.SizeOf(info),
SHGFI_ICON | SHGFI_USEFILEATTRIBUTES | SHGFI_SMALLICON | SHGFI_ADDOVERLAYS);
It works 100% fine, but I have noticed...