winforms

AnimateWindow API transparency problem with RichTextBox

I'm using the AnimateWindow API to show or hide a Form with a slide animation. The problem is that if the Form contains a RichTextBox control, it doesn't display this control correctly. It's transparent and doesn't show any text. After the animation is complete, double clicking somewhere in the control will reveal lines of text. I've c...

C++ How do I use an onClick event to create a textbox?

I'm trying to create a visual c++ application which has a button that when clicked creates a text box, and when clicked again creates a text box underneath the last one created. Then a button which deletes the previously created text box. Where do I start? Does anyone have any samples of this? Thank you! ...

C# login examples

Hi, I am having trouble hiding my main form for a login form. Once user has logged in to close login form and show main form. I have been confusing myself that much I have deleted all code and started fresh. I can hide the login form fine. I was unable to hide the main form called with Application.Run(new MainForm()); Login form lo...

Change connection string for all of projects in a solution

Hello everyone, I have 2 projects in one solution. How can I change both connection string in one of them? ...

Form is not laid out correctly

I have a WinForms form hosted in VB6 application (I am not sure if this is significant). Sometimes form controls are layouted incorrectly (primarily Anchor property doesn't work). If I just resize a form by mouse - the form is drawn as it should. Is there any method that may solve my layout problems without manual form resizing? I tried ...

How do I make my VB.NET custom button work?

I made a custom button to input keypresses: <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class KeyInputButton Inherits System.Windows.Forms.Button 'UserControl1 overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(...

I get a Argumentexception by binding a customer to a WinForms Bindingsource

Hello, I'm learning NHibernate with Fluenthibernate. I'm using it with C#, Winforms and BindingSource, and I get a Argumentexception by loading a Customer without orders. What can I do or what is wrong? Mapping: public class CustomerMap : ClassMap<Customer> { public CustomerMap() { Id(x => x.Id); HasMany(x => x....

Task parallel library replacement for BackgroundWorker?

Does the task parallel library have anything that would be considered a replacement or improvement over the BackgroundWorker class? I have a WinForms application with a wizard-style UI, and it does some long-running tasks. I want to be able to have a responsive UI with the standard progress bar and ability to cancel the operation. I've...

C# Graphics being overwritten

In c# I am using a PictureBox on a win form. I am trying to recreate MSPaint to learn about the Graphics Object. It all works fine and dandy except that when another window is on on top of the PictureBox, or the entire form is resized, what is drawn under the other window in there is removed. Here is a scaled down version of the code...

Why does C# compiler kick in the second time?

I have a WinForm app. I compile it, double-click on it. Predictably, csc.exe kicks in, then goes away, and the application comes up. I am assuming that at this point the application has been jitted, so no reason for csc.exe to kick in ever again. I then quit the app and start it again. I see csc.exe kick in again. What's going on...

WPF radial-gradients

Dear Board, I have tried the following code, but the last line causes an error *Error Argument '1': cannot convert from 'System.Windows.Media.RadialGradientBrush' to 'System.Drawing.Brush' * I have visual studio 2008 <CODE> /* using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using Syste...

How Can I Add An Item To Folders Menu Of Right Click?

I need to add an item to folders right click menu when clicked send folder address to my app. how can i do it? it'll be a great help if you describe how to make popup menu for that item and how can i use images for items? something like WinRAR.... and what about file types? same ways? thank you. ...

How do applications read assemblies and visualize .NET forms?

Applications like Passolo, Alchemy Catalyst and Lingobit Localizer can read DLLs and visualize .NET controls, such as windows, forms, and dialogs. How might something like this be done? ...

winforms visual studio installer License agreement problem

Hi, I've having trouble adding a rtf file to license agreement installation window, does anyone have any tips to get it working. Thanks. ...

Calculate scrollbar thumtrack size

I have a control where I use SetScrollInfo (user32) to set the nMin and nMax. How can I calculate the right size of the nPage (or the thumbtrack)? I know it must be some percentage of the client area, but I'm not really sure on the calculation. I am not using AutoScroll and associated properties so that I can have maximum control over sc...

How to use Matrix and scrollbar translate offsets for drawing

I'm using a Matrix to set a transformation on my Graphics object during OnPaint. I would like the scrollbars to translate the matrix when scrolled; something like this in OnScroll: float offset = se.NewValue - se.OldValue; if (offset == 0) { return; } if (se.ScrollOrientation == ScrollOrientation.HorizontalScroll) { this.Trans...

How to catch/handle the window form's hidden/showed events?

In my application I call App.Current.MainWindow.Show()/App.Current.MainWindow.Hide() to show/hide my application but I don't know how to catch the event when the form is hidden/showed. Please help if you know how to! ...

Enumerate all windows created by an application

I have a WinForms application. That application have a rich functionality. It can create many windows (System.Windows.Forms.Form). Application is not MDI. I need to enumerate (I need to know) all windows created by that application. It creates windows in the same thread. I mean it doesn't create new process or something. Of course, I ca...

c# radial gradient brush effect in GDI and winforms

Dear All, I have created a c# windows application and written 75% of the code. The program allows the user to create a flow chart, and will shade the flow chart shapes according to their status. I wanted them to become 3d buttons such as from the website Webdesign.org Rather than create a PNG for each button, I wanted to create the...

C#: Popup form blocking despite BackgroundWorker

Hi, I'm using .net 2.0 and I've created a form (System.Windows.Forms.Form) for displaying information during long running tasks. When I start a long running task, I create a new instance of this form, call .Show() and start the BackgroundWorker. But even though I use a BackgroundWorker for doing the work, the form indeed shows up, but...