I want to create an instance of an object that has to be set to each control's specific property.
As is VS designer just creates a separate instance for each control.
How do I do this so that my shared object shows up at the bottom of the VS designer window, like a timer, or a imagelist.
...
For Windows.Forms, I have an application that needs to get a unique install id for each install from my server, and then persist this data so once registered, the install ID is included on all communications back to the server. The application is in occasional contact with the server.
How can I persist this data on the client in a way ...
I'm using the following code to check if a valid date has been typed into a textbox:
public bool ValidateDate(Control ctrl)
{
if (!string.IsNullOrEmpty(ctrl.Text))
{
DateTime value;
if (!DateTime.TryParse(ctrl.Text, out value))
{
return false;
}
}
return true;
}
private void ...
Is it possible to wrap the old System.Windows.Forms controls in System.Windows.UIElement? I know that the Browser Control is somehow wrapped and the base is from System.Windows.Forms.
If this is possible, would the implementation cause any consequences?
...
I have a UserControl with a tree on it. It uses multithreading to add nodes to it. I have a function called Expand which I need to execute after filtering completed and since I'm a newbie with multithreading I'm not sure how to do that. Here's my code:
class MyClass : UserControl
{
private Thread nThread;
private bool searchLoad...
I'm trying to bind a Textbox.Text to Form.Text (which sets the title of the form).
The binding itself works. But, the title isn't updated until I move the entire form.
How can I achieve Form.Text being updated without moving the form? I'd like Form.Text being updated directly when I type something in the Textbox.
Edit; I set the title ...
I was wondering if somebody could help me use string split to get all occurrences of text in between <p> </p> tags in an HTML document?
...
I have a set of controls inside a WindowsFormsHost and I would like to capture the current view and just save it as an image, I however only get some Panel visible in the Image.
Is it possible to use the WindowsFormsHost as a "Visual" and capture the wrapped controls?
See my example:
<WindowsFormsHost x:Name="windowHost">
<wf:Pane...
Hi,
I've a winforms with some controls and an ErrorProvider. The control's Validating events are used to validate the data and report the error to the ErrorProvider if there is any. This work great when the user enter wrong informations into the control and leaves the control.
However, the validation does not happen if the user click o...
I am working on a windows form that has a TabControl named tabDocuments. I came across this piece of code that removes all pages from the TabControl.
for (int i = tabDocuments.TabPages.Count - 1; i > -1; i--) {
tabDocuments.TabPages[i].Dispose();
}
tabDocuments.TabPages.Clear();
The person who wrote this code has already left ...
I have a Winforms App (.NET 3.X) That runs a method in a class to process some data. The method periodically raises a StatusUpdate event with a count of the number of items processed. I have a ToolStripStatuslabel on the Form that i would like to update with the count. The problem is that status label never updates with this count until ...
First off, I found the solution to the exception. I'm more curious why it generated the specific exception it did.
In my scenario I'm adding a POCO to a ListBox like so:
myListBox.Items.Add(myPOCO);
This was generating an OutOfMemoryException. The problem was that ToString off the POCO was returning null. I added a string.IsNullOr...
I am trying to show a tooltip when mouse hovers on a treeview node. But the tooltip is not showing up.
This is my code:
private void treeView1_MouseHover(object sender, EventArgs e)
{
toolTip1.RemoveAll();
TreeNode selNode = (TreeNode)treeView1.GetNodeAt(Cursor.Position);
if (selNode != null)
{
if (selNode.Tag !=...
Hi,
I have a windows application developed in VS.NET 2003.
sometimes I am getting System.NullReferenceException exception from CallWindowProc().
Here is the stack trace of the exception
Error_Stack_Trace : at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr...
I have my solution implemented (basic solution) and I'm happy.
Problem is when I add new items to a ToolStripItemCollection using the 'Add' method, I get a few overloads ... the meaningful one being a string parameter, an image parameter and an EventHandler parameter.
Because my drop down list is going to be serving as a dynamic histo...
I have a DataGridViewComboBoxColumn being programatically databound to a generic list. I also have another combo box on the form. Whenever I change the value of any of the ComboBoxes in the datagridview, the ComboBox on the form also changes its selected value.
I didn't intentionally write any and don't see any code that would even re...
We have a customer who needs some simple forms (probably we would be creating a simple Winforms app for them) but there is a requirement to capture a mix of input fields plus some freehand drawing. It's the freehand drawing which worries us.
They will be using a tablet pc with stylus. The customer is running Office 2007.
This project ...
I am brand new to using RegEx's and need a bit of a jump start to get the ball rolling. The RegEx I need is, hopefully, pretty simple.
All it needs to do is verify that the text entered follows the following format:
00.000 (2 digits, a period, 3 digits).
Any advice on the the RegEx itself and how to implement would be greatly appreci...
I would like to create some custom UI controls that work with both WPF and Windows Forms.
Is this possible?
If so, can I create these controls in WPF or do I need ot use a Windows Forms control?
Are there any other considerations?
...
Visual Studio creates code similar to this:
namespace MyCustomControls
{
partial class MyCustomControl
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>...