I have a DataGridView control in a winforms app that I'm working on.
The DataSource is set to IQueryable that I get from our service layer:
dataGridView1.DataSource = (from c in _customerService.GetAll() select c);
In the example I'm working on, I have a cancel button that I wish to use to revert changes. If they hit cancel, I do not...
I'm setting up my remoting connection like this:
port = new Random().Next(REMOTING_PORT_MIN, REMOTING_PORT_MAX);
TcpChannel chan = new TcpChannel(port);
ChannelServices.RegisterChannel(chan, false);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(NotificationService), "CallOnMe.rem", WellKnownObjectMode.Singleton);
notServic...
The standard System.Windows.Forms.TabControl component draws a border around the TabPages it contains. If you set its Dock to Fill, these borders run up to the edge of the parent control, but they're still there, taking up screen space.
In Visual Studio, if you dock two windows in the same place, you get a TabControl-like set of tabs a...
I'm a C# developer working with either Windows Forms or WPF.
Sometimes I have to deal with unmanaged code, which I don't like.
I think that the main reason why I dislike this is ignorance. I don't know the underlying Win API.
I think that I'm not the only person who has negative feelings against unmanaged Windows code.
Question: Should...
If you have a disabled button on a winform how can you show a tool-tip on mouse-over to inform the user why the button is disabled?
...
I'm trying to center a fixed size control within a form.
Out of interest, is there a non-idiotic way of doing this? What I really want is something analogous to the text-align css property.
At the moment, I'm setting the padding property of the surrounding form to a suitable size and setting the Dock property of the control to fill.
...
Hi All,
I have a thought about this but could not come with a good solution.
I have a windows application. I use enterprise library (3.1) Data Access Application Block. Now I use the DataProtectionConfigurationProvider to encrypt the connection strings.
This application has to be deployed across multiple machines. I don't want the end...
I have a form with several components like textbox and combobox and I need to know when click in the out button if was any changes in the form.
There are any way to do this?
...
I'm working on a solution that contains a Windows Service and a WinForms client that interacts with that service.
In my pre-build and post-build events, I have some net start and net stop commands to start and stop the service, but there are times when this causes a problem (file's not found, service is already stopped, etc.).
Is the...
In good old MFC, the DDX routines would have built in validation for form entries. For example it was possible to automatically check if the user entered a string in a text box meant for numeric input.
Is there any such mechanism in Winforms? Obviously one can add handlers for the 'onChange' etc kind of events and do the processing the...
I'm looking for a free advanced dropdown list control. Basically something that provides a dropdown list which can have icons, and multiple bits of text per entry (preferably one large bit of text and then a smaller bit of text underneath).
Anyone know of such a control? I've had a look but can't seem to find one.
If I can't find it I ...
I am developing a form in .NET Compact Framework, which hosts a variable number of controls. Every control should have the same width as the form. When there are only a few controls, no vertical scrollbar appears. When there are more controls than they can fit in one form, a vertical scrollbar appears. The width of the controls should t...
It's quite common to have a form with a checkbox stating "Use foo" immediately followed by a textbox where the user can input the "foo value" he want's to use. Of course, this textbox is useful only if "Use foo" is checked
I don't know the best way to deal with this situation :
Disable the textbox (ie textboxfoo.Enabled=false;)
Hide i...
I'm trying to show a windows forms tooltip inside a datagrid to highlight an error. The problem I have is that everytime I call tooltip.Show("You have an error", datagrid, 0, 0), The tooltip is confined within the datagrids boundaries and doesn't go outside, which ultimately means the tooltip itself covers up the actual row where the e...
I have a Managed C++ project that compiles as a lib and is referenced by a windows forms .exe. This lib in turn references a DLL which contains localization code. The constructor of ResourceManager expects an Assembly object representing the parent of the resource. How do I create a new ResourceManager that references resources stored in...
In my main method, I start the main form as usual:
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
In the main forms load thing I have the following, which will ask the user to log in and stuff.
using (loginForm)
{
...
I have TextBox controls on a WinForm bound to a BindingSource. If I set CausesValidation = false on these controls it doesn't update data source on tableAdapter.Update() method. I know that Control.Validating event does this saving but how can I update source if CausesValidation is disabled?
...
I have made a class which a form can inherit from and it handles form Location, Size and State. And it works nicely. Except for one thing:
When you maximize the application on a different screen than your main one, the location and size (before you maximized) gets stored correctly, but when it is maximized (according to its previous st...
I have a winform with a listbox and a treeview.
Once my listbox is filled with items, I want to drag them (multiple or single) from the listbox and drop them in a node in the treeview.
If somebody has a good example in C# that would be great.
Thanks in advanced
...
How can I allow the users of my program to type in a value and have it auto-complete, however, I also what to prevent them from entering new data because it would cause the data to be unfindable (unless you had direct access to the database).
Does anyone know how to do this?
The reasoning behind not using just a dropdown style combobox...