Skip to content

Windows Forms

Desktop and Windows Forms development

This category can be followed from the open social web via the handle windows-forms@forum.codeproject.com

2.1k Topics 7.1k Posts
  • Folder Permissions - Urgent Help Please

    help csharp sysadmin question
    3
    0 Votes
    3 Posts
    15 Views
    N
    you need to change the user that your application is running under. see samples: User Impersonation in .NET[^] http://stackoverflow.com/questions/1168571/run-code-as-a-different-user-c[^] http://stackoverflow.com/questions/125341/how-do-you-do-impersonation-in-net/7250145#7250145[^]
  • Label and LinkLabel deprecated

    visual-studio winforms com question learning
    3
    0 Votes
    3 Posts
    15 Views
    N
    Thanks for the info, funny how it takes them ages to change something that seem logical...
  • 0 Votes
    2 Posts
    12 Views
    L
    Tridip Bhattacharjee wrote: one thing is not clear to me which function is getting called first when user scroll datagridview. You should read more of what is one MSDN, as it explains the topic quite well. The "ValueNeeded" event is called for each cell that needs painting, regardless of what causes the paint; whether that is a scroll, or maximizing the form. If the grid needs values, that event is fired. Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
  • 0 Votes
    2 Posts
    11 Views
    L
    Your loaddata-event is when the memorycache is being built. The enddata when it is done. Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
  • Use of Unicode characters -> Syntax.

    question
    3
    0 Votes
    3 Posts
    14 Views
    M
    THANK YOU! I will.
  • Windows Form Shown

    csharp c++ visual-studio
    6
    0 Votes
    6 Posts
    20 Views
    M
    Thank you!!
  • Highlight text only in a listview subitem

    tutorial csharp question
    6
    0 Votes
    6 Posts
    23 Views
    B
    Yeah, it is a rather heavy control. But I cut out about 65% of the code in the application I was using it for, so that is a big win. (Yes, 65% of the code was for handling list view related operations, and I was only about 30% done with the program!) What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???
  • Accordion in windows Forms

    winforms help question
    9
    0 Votes
    9 Posts
    36 Views
    S
    Yeah I have already been there. But if my panel has button/ Textbox or any other controls I do not understand how to proceed further. Your help is much appreciated. Thanks Happy Coding!
  • PRINT A DATAGRID WHITH VB.NET

    csharp
    4
    0 Votes
    4 Posts
    15 Views
    L
    Member 11630648 wrote: I come from cote d'ivoire (ivory coast) Cool :cool: The forums are primarily based on English*. Having a single language makes it easier for all, as it means we need not translate all technical documents. It has the added benefit that we can communicate regardless of the official language in the country. I'm going to assume English was the natural choice, being the simplest (or most widespread) of the bunch. Your headline was fine. If you're unsure, use Google Translate. *) with two major exceptions :) Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
  • The name does not exist in the current context

    graphics design help learning
    3
    0 Votes
    3 Posts
    17 Views
    A
    An easy idea would be, "you need to create a variable with that name, or you need to see if variable name has any typos". Secondly, as already mentioned. [code][\code] is supported on some websites, such as Quora. On CodeProject, you have to embed your code inside <pre> tags, or you can try out using the new Markdown[^] on CodeProject. The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~
  • Joystick Windows Forms User Control

    winforms help
    2
    0 Votes
    2 Posts
    9 Views
    L
    You have an actual joystick? Use the DirectX API: http://bytes.com/topic/c-sharp/answers/237177-how-read-joystick-directx-using-c[^]
  • checkedlistbox item height [modified]

    graphics tutorial
    5
    0 Votes
    5 Posts
    20 Views
    S
    Thanks, I've been trying to figure this out for 8 years, I can finally move on with my life now :laugh:
  • GridView checkbox cell

    css question
    4
    0 Votes
    4 Posts
    15 Views
    W
    Got it. I had this.Show(); positioned before the initialization block above. This raises the BeginEdit event for the first cell which seems to prevent the altering via program. There are 2 ways to solve this: move this.Show(); or insert LLinGrid.EndEdit(); behind initialization, Thanx for your interest.
  • 0 Votes
    3 Posts
    12 Views
    D
    You GDI things on the Device Contexts provided by the forms. I personally prefer this approach to WPF. Geek code v 3.12 GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- r++>+++ y+++* Weapons extension: ma- k++ F+2 X
  • unsure of controls to use

    csharp visual-studio com question
    2
    0 Votes
    2 Posts
    8 Views
    L
    minnie mouse wrote: I want to do this in C# Then you would probably get a better response in the C# forum. However, the control you need will most likely be a ListView[^].
  • How to avoid color changes when button is disabled

    winforms tutorial question
    4
    0 Votes
    4 Posts
    15 Views
    X
    In fact the BackColor of control doesn't change and only ForeColor and BorderColor change. Set FlatStyle to Flat, Set a non system BorderColor in FlatAppearance, Set a non system BackColor and you will see background and border will not change. Only ForeColor changes to show difference of enabled and disabled button.
  • 0 Votes
    3 Posts
    12 Views
    X
    Long time ago, I made an application near to your requirements. The main design was: An abstract base Shape class having some methods like a void Render(Graphics) and a method for hit testing,bool HitTest(Point). Shape classes for custom shapes that are needed on each layer; shapes like point, line, icon, path, etc that inherit from abstract Shape class. Each derived shape has its own properties and overrides Render method and renders itself on the graphics object; also overrides HitTest method to check if it contains a point. A Layer class that contains a List of Shapes and a void Render(Graphics) and calls render method of each shape. (You can restrict each layer to specific types of shapes, you can implement z-order management for shapes, etc) A Map class having and Image and a List<Shapes> and Save and Load to/from file. (You can handle Active layer and active shape easily.) A custom control that has a Map property. This control is responsible for rendering layers and handling user mouse interaction and update layers. This control overrides OnPaint and mouse events and enables double buffering. Hope this idea helps you.
  • rdlc report in c# winforms programmatically

    csharp winforms help
    3
    0 Votes
    3 Posts
    15 Views
    X
    Probably the name of dataset in your Report is different than "Employee". Open your report and in "Report Data" window, under the node "Datasets", check the name of your dataset, for example if dataset name is "Dataset1", your code should be: Microsoft.Reporting.WinForms.ReportDataSource repds = new Microsoft.Reporting.WinForms.ReportDataSource("DataSet1", ds.Tables[0]);
  • 0 Votes
    3 Posts
    11 Views
    X
    Maybe this help: enum DWMWINDOWATTRIBUTE : uint { NCRenderingEnabled = 1, NCRenderingPolicy, TransitionsForceDisabled, AllowNCPaint, CaptionButtonBounds, NonClientRtlLayout, ForceIconicRepresentation, Flip3DPolicy, ExtendedFrameBounds, HasIconicBitmap, DisallowPeek, ExceludedFromPeek, Cloak, Cloaked, FreezeRepresentation } [DllImport("dwmapi.dll")] private static extern int DwmSetWindowAttribute(IntPtr hwnd, DWMWINDOWATTRIBUTE attr, ref int attrValue, int attrSize); protected override void OnHandleCreated(EventArgs e) { base.OnHandleCreated(e); if (Environment.OSVersion.Version.Major >= 6) { int attrValue = 1; int hr = DwmSetWindowAttribute(this.Handle, DWMWINDOWATTRIBUTE.TransitionsForceDisabled, ref attrValue, 4); if (hr < 0) Marshal.ThrowExceptionForHR(hr); } }
  • Closing a dropdown box on a toolstrip item

    csharp question
    6
    0 Votes
    6 Posts
    24 Views
    X
    If I understood your question correctly, you have a ToolStripComboBox as an item of a ToolStripDropDownButton and want to close dropdown when an item of combobox is selected; so you can do this: private void toolStripComboBox1_SelectedIndexChanged(object sender, EventArgs e) { ((ToolStripItem)sender).PerformClick(); }