winforms

Color.ToArgb relation between 5046311 and 14221235 ??

the form backcolor is 14221235 , but when i set the customcolor in colordialog to equal the form backcolor, it sets it to 5046311 !!! what is the problem? this is how i am getting the background color: get_background = Str(Abs(Form1.BackColor.ToArgb)) the reason i am turning it into a string is because i will feed it into a string wh...

Windows Forms (Or GUI development in general) advice.

How should I develop a form that can resize nicely? While that sounds like a simple question the problem I'm struggling with is the fact I'm reproducing an existing application I made in Swing several years back. Its built around a single form that hides/reveals panels as you select different options. Its around 600 x 700 pixels wide ...

Saving last selected item on a combobox

Hi, I want to save the last selected value in a combobox that displays the data of a DB column, I've tried to save it as a text property but it doesn't work. what can i do? thanks in advanced. EDIT: The code generated in the settings.settings file is like this: [global::System.Configuration.UserScopedSettingAttribute()] [gl...

How do I dynamically add controls into windows form splitter control while window is minimized?

I was tracking down a bug in a small .NET app written here at our studio. The dialog is basically a status reporting dialog that tries to dynamically add 1 (or more) progress bars to an existing dialog depending on the number of operations that are currently being logged. We have a dialog that has a main dialog that contains a splitter...

How can a Windows Forms ListView be programmically scrolled left/right?

How can a Windows Forms ListView be programmically scrolled left/right? Maybe a SendMessage can be sent to the control's horizontal scrollbar? ...

GUI development with c#

Hi, I have a GUI that has a treeview on left side and a panel on the right side. The panel contains components like dropdown, radio buttons, textboxes,etc and I need to populate those according to the node selected on the tree. Works fine till here. Howeer when I click on a button or any component on the panel, the node that was previo...

why are max values 240 and 239 for saturation and hue?

in colordialog why are these values the max values? to what do they correspond? ...

purpose of dividing saturation / 50 and hue / 50?

i am controlling the hue and saturation of the backcolor of the form with scrollbars: Private Sub tbHUE_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbHue.Scroll Dim r, g, b As Integer HSVtoRGB(r, g, b, tbHue.Value, tbSaturation.Value / 50, 255) Form1.BackColor = Color.FromArgb(r, g,...

What value is LVM_SCROLL assigned?

What value is LVM_SCROLL assigned? i.e. SW_HIDE is assigned to 0 Public Const SW_HIDE = 0 What value is LVM_SCROLL assigned too? Where can this value and other constant values be found? I program in a language called PL/B. It gives access to execute windows APIs but it does not have all the constants defined. Of course, the examples...

Where can I find a good tutorial on bubbling?

I'm new to C# and would like to allow to Windows forms to comminicate with each other. I googled bubbling in C# but it wasn't much help. What are some good ways I can learn bubbling? EDIT: I want to have an options form that is shown/created when my user clicks on Edit->Preferances. I then want the settings the user changed in the optio...

C# Delay Modal Dialog showing on Load, whilst allowing execution to continue

I have a form being displayed by a static method. This static method calls ShowDialog on the form: //Static method on LockWaitForm public static LockDetails Lock(string lockedMessage, object[] params parameters) { using (LockWaitForm form = new LockWaitForm(parameters)) { form._lockedMessage.Text = lockedMe...

Determine when a winforms datagridview column type has changed in vs.net

I have a custom datagridview column with some extra properties that, in order to improve performance, need to be set only when the column type changes. It's not possible to override the ValueType property and I can't see any relevent events for a datagridviewcolumn. Is there a workaround? ...

Antialiased text on transparent bitmap

I'd like to draw antialiased text on a transparent bitmap and have the antialiasing drawn as alpha blended pixels. This way, I can draw the bitmap onto any color surface (or an image, for that matter) and the antialiasing still looks fine. Here is a simplified sample showing the problem: protected override void OnPaint(PaintEventArgs e...

C# using the scrollbar control / event (without textbox or window scroll)

I need to allow a long label to be scrolled through on it's own. I do not want a text-box of any sort. I would like to be able to format the text inside. It definitely needs to scroll own its own, not with the window. I have added a scrollbar successfully, but I have no idea how to begin to use it's event/s. thanks i tried using a pane...

How to trap the keyboard strokes on a c# win forms application (CTRl + alt +Del)

Is there Any way to handle the crtl + Alt + Del Key combination. Take for instance in a quiz application (Win Forms ), the user should not be able to switch to other windows till the test is over. I'm able to capture the ctrl and alt key strokes individually, using c# standard properties. but once they user hits the del key . The contr...

DataGridView doesn't call Paint method when InvalidateCell is called

This a WinForm C# application problem. I have a DataGridView and I need a customized type of DataGridViewColumn such that when my mouse is over a cell on that column, the cell paints something special on it. I found a way of overriding the DataGridViewTextBoxCell to do the painting myself. That article shows an example of implementing a...

Fails to start .NET app, ConfigurationErrorsException

Hi, I've installed a clean XP virtual machine for test purposes, only .NET 3.5 SP1 redistributable is applied. When I try to start our WinForms app, it gives the following exception: System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsExcept...

Value of tag property disapears

I'm busy with a simple application. It reads xml and puts the information in a treeview. I do this by creating TreeNodes and nest them, and finaly, return the root treenode. Because I want to show some extra information when a treenode is selected, I put the information in the tag property of the TreeNode. In this way, I should be able...

C# - Winforms - Global Variables

I want some variables to be global across the the project and accessible in every form. How can I do this? ...

c# set a treenode text in 2 colors

Hello, I've got a treeview that is populated in 3 levels. I've added in each group level the number of childs it has. Now I want to set the that number in a different color or in bold. Example: tree [3] |_ firstGroup [2]   |_ firstChild   |_ secondChild |_ secondGroup [1]   |_ thirdChild this is a windows forms application. I think i...