I would like to use the BackgroundWorker to perform a db transaction from a GUI.
How can I command the BackgroundWorker to perform the work and then WAIT for the worker to complete while keeping the GUI responsive?
Do I have to use DoEvents for this purpose, or is there another way?
...
I am not sure if anyone can help with this, but I inhertied this code and I have no idea what the issue is nor am I familiar with the WndProc method. The area that is not running is the "' check for custom draw message" section. I need it to run the ProcessListCustomDraw(m) method so some thumbnails are generated. I beleive the origianl ...
My project has a Guest folder and an admin folder.
Guest has a guest1.aspx page and admin has admin1.aspx page.
Now I am trying to figure out a login control which will check the role of the user and send them to the respective pages accordingly.
The names are not in the database or the active directory...
These names are on the wind...
I have a list of business logic objects that is bound to a Winforms DataGridView, and it contains DateTime fields. By default they get converted into a long date and time string.
I want the fields to be converted automatically into HH:MM format. I've discovered that I can attach a TypeConverterAttribute to a field with a subclass of Typ...
I've been using WinForms databinding to display data from a database mapped with Fluent NHibernate, and that's been working great.
For example, I can just set a DataGridView's DataSource property from an entity's IList property, and voila - there's all the data!
But now I need to start adding and saving new data rows, and that's not g...
I am looking at DataGridView to assist with the following functionality without DataSet/Table usage.
I am replacing few columns with the DataGridViewComboBox. As a specific and slightly contrived example below, I am replacing AccessID column on BindingList (of Setting) :
class Setting
{
public int AccessID { get { return ... } set { ....
I asked a similar question here; thanks to everyone who provided suggestion! However, it seems that my problem is bigger than the one described above, so I am posting a new question.
The issue is that I need to keep my UI responsive when I am loading a large document using a third party control called document. The document is a class e...
Is it better to use friend or public forms in vb.net? What are the advantages of each?
I notice when you import a vb6 project, the forms come in as friend, but when you add a new form in vb.net it is public. I have not seen any difference in the way they work, though, so I must be missing something.
...
Hey, I'm using the FastObjectListview and now I need to sort on 2 columns.
So I tried using the example I found on the ObjectListview website but I can't get it to work.
class MyCustomSortingDataSource : FastVirtualListDataSource
{
override public void SortObjects(OLVColumn column, SortOrder order) {
// do some amazing sor...
I'm using pinvoke "user32.dll" to send my application to back (behind all other apps) so it sits on desktop and vice versa. At the moment it just toggles - back/front. Is there a way to detect if my app is at the back and bring it to front or if it's on front and send it to back? THanks.
...
Hi! I'm new with DOT.NET...
I'm trying to do:
Build a winform with tree of lectures
below i put a propertyGrid
The propertyGrid must display the details of Lecture:The Subject,language ang Lectors.
I want to add lectors to certain lecture "Lectors Collection" property in collection editor
Question:
I need the LectureID parameter to be...
I want to show some part in my tooltip text as bold.
i am doing this
string toolTipText = "tooltip text <b> Text to be in bold </b> rest of tooltip text.";
this.toolTip1.SetToolTip(this.linkLabel1, toolTipText);
in the above code i want the text inside and tags should come in bold.
Thanks in advance....
...
Hi everyone,
I'm having 2 forms. From one form I created and shown the other form. It's working great. But when I try to close or Dispose that form from the form that created it I get following Exception:
Exception :
Value Dispose() cannot be called while doing CreateHandle().
Stack Trace :
========================
at System.Wi...
I want to move a control in panel1 to the Red Line end from the following example:
private void panel1_Paint(object sender, PaintEventArgs e)
{
e.Graphics.DrawLine(Pens.Red,
new PointF(10.7f, 20f), new PointF(50.5f, 20f));
}
Is that possible in .NET 2.0?
Background
I draw some paths using the floating (world) coordinate...
I'm using a CheckedListBox control in a small application I'm working on. It's a nice control, but one thing bothers me; I can't set a property so that it only checks the item when I actually check the checkbox.
What's the best way to overcome this?
I've been thinking about getting the position of the mouseclick, relative from the left s...
Do you have a good solution for keeping a 'Please wait' winform 'painted' while an application is performing a long running task ?
I've tried using form.refresh() on each step, but there are a few long running queries that take place, which means that this isn't frequent enough.
Basically this SO Question but, on C# in Excel through VS...
MouseWheel event doesn't fire
when I' am using any control (ListBox, Panel, TextBox) with scrollbars.
To reproduce problem:
public class Form1 : Form
{
private readonly Button button1;
private readonly TextBox textBox1;
private void button1_MouseWheel(object sender, MouseEventArgs e)
{
ToString(); // doesn't fire when unc...
I have some trouble showing a disabled Form in non-modal state. Here is the example code:
public partial class Form1 : Form
{
// ....
private void button1_Click(object sender, EventArgs e)
{
try
{
Form2 form = new Form2();
form.Enabled = false;
form.Show(); // works, but...
Is there a better way to handle the task of doing something after the user has chosen to exit a WinForms program than this :
[edit 1 : in response to comment by 'NoBugz] In this case there is no ControlBox on the Form, and there is a reason for putting one level of indirection in what happens when the user chooses to close the Form [/e...
i have a list of events "Appointments" in my database, like at 3:00pm etc, and they have irregular intervals like one after 15 mins and next after 30 mins and next after 25 mins. One way is that i run a thread/timer that checks the database every minute whether it is the minute of next appointment or not.. i want some other mechanism by ...