winforms

Data input for many to many relationship in windows forms

I'm developing a windows form application ported over from a very basic lotus notes database app. As an example of There is a "Jobs" table a "Parts" table and a many to many relationship table "Job_Parts" with JobID and PartID. When adding a new job record I need a input method for the user to select from the parts list and I envision t...

.NET ListView: event after changing selection

Hello, On the ListView control, I need an event to fire after the selection changes, but only once per user action. If I simply use the SelectedIndexChanged, that event fires twice in most cases (once when the previous element is unselected and once more when the new element is selected) event if the user only clicked on the control onc...

Restricting users to access C drive in C#?

Hi , i have a winform to merge few file and save the merge files in a Directory. The directory in which it is saved ,it deletes the whole files and subdirectory in it . Now i want that the user should not be able to save the file in My Computer,C,D Drives. User can choose the directory through FolderBrowserDialog. How can i restrict...

Master-Child page concept in winforms

Hi How can i achieve master child page concept in c# winforms application? Regards, Nagu ...

Input mask for partial date without year in vba

I have the below input mask which take in the date format: 21/10/98 00/00/00;0;_ But i need to be in the below format : 21/10 (without year) This syntax of input mask shown below 00/00;0;_ is not giving the right answer. Please help More clarification: If we right click on the text box of vba form and take the input mask pro...

How to programmatically add items to CollectionEditor's list/listbox/collection ? [modified]

I have custom collection editor and I want to programmatically add items to it's list (collection) so they will could visible in a listbox. How I can do that? I know about CollectionEditor's AddItems method, but it takes collection object as a parameter, but I cannot figure out a way to get CollectionEditor's inner list object... :/ [up...

Testing PictureBox in white

Hello, I am currently evaluating the White testing framework. Pretty amazing stuff! Everything looks pretty promising, but I have run into a small wall. How can I test a .NET 2.0 PictureBox? There is no predefinied UIItem for that. Though there is the Image class, but how would I use it in combination with my PictureBox? I also tried ...

C# WinForms Read XML File - Only Specific Nodes.....

I have an XML File: <Database> <SMS> <Number>+447761692278</Number> <DateTime>2009-07-27T15:20:32</DateTime> <Message>Yes</Message> <FollowedUpBy>Unassigned</FollowedUpBy> <Outcome></Outcome> <Quantity>0</Quantity> <Points>0</Points> </SMS> <SMS> <Number>+447706583066</Number> <DateTime>...

Is it safe to use the same event handler for different Windows Forms Controls?

Is this good practise? I have 3 DataGridView's and I want to have a facility that allows a user to sort the data by clicking on a column header. I could've had an event handler for the ColumnHeaderMouseClick event for each of these DataGridView's, but instead I made one: private void dataGridView_ColumnHeaderMouseClick(object sender, D...

How to see windows messages of a dialog shown with a second thread?

I've registered a message filter using Application.AddMessageFilter(m_messageFilter); using this I can log all of the mouse clicks a user makes in the application's user interface. However, one dialog is run on a separate thread, with code something like: void Run() { using( MyDialog dialog = new MyDialog() ) { dialo...

Setting the focus for Windows Forms element on WPF

Hi I am fighting for two days with this problem, and I am dying for a solution I have huge complex WPF window, with a tabControl One of the tabItem, hosts a WindowsFormsHost, which host some old windows forms controls When I am navigating to this tab, I am trying to set the focus on one of those controls Keyboard.Focus doesn't work, b...

simple chat application c# winforms

Hi I need a simple chat application using c# winform. How do i start? is there any sample available for this? Regards, Nagu ...

VB.NET control GDI handle leak?

I have a problem with a control leaking GDI handles. This is the cut-down version of the control: Public Class FancyLabel Inherits Label Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs) e.Graphics.TextRenderingHint = Drawing.Text.TextRenderingHint.ClearTypeGridFit MyBase.OnPaint(e) ...

.NET WebBrowser Control as User Interface

First a few definitions to keep things clear. User: A live person, using the software Client: A company that is paying for a customized version of our software for their users. We currently have a few applications that are going to require significant changes in the user interface based on which client the user belongs to. We ...

How to display an image in a datagridview column header?

At runtime, I am adding a DataGridView to a windows form. The final column is a DataGridViewImageColumn: Dim InfoIconColumn As New DataGridViewImageColumn MyDataGridView.Columns.Insert(MyDataGridView.Columns.Count, InfoIconColumn) Adding the following code will get my Information Icon (bitmap) to display in each of the column cells bu...

Simulate Winforms Button Click Animation

I have a button and inside my button I have an image control. When the users click on the image I'd like to animate the button so it appears the button was pressed. I don't really care whether the actual button press event fires or not--it's the illusion of a button press I want to see. Note: the only options I see on the web involv...

Empty a DataGridView

Hi all, I have a datagridview in C# that fills with customers based upon search criteria when a person clicks "search". The problem I'm having is that when The person clicks on the search button more than once to search for customers, or if the user wants to do a different search, all of the details from the last search are still in the ...

Format phone number in datagridview

Hi All, In the application I am working on, I have a TableAdapter, and a RadGridView (Telerik control - their version of the DataGridView). The TA is pulling different elements from our database, including PhoneNumber, which is stored as varchar. In my GridView, I would like to display this format as (123) 456-7890. Unfortunately, I ...

WinForm custom controls: now or later?

I'm planning to write my first program (it'll be in C#), and I need help with a decision. I know I'll want to use custom controls in the final version of the program (probably these), but someone advised me to use standard WinForm controls until the program is running right. They said once things are running right, then I could replace...

MVC Architecture - How to represent Lists

I'm not positive I have the right architecture for this problem. Let's say I have a Person object that has 1 or more Attribute objects associated with it. For the interface, I have a list of Person objects, a Person view, and another control with tab pages that represent each Attribute object associated with that person. How would an ...