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
  • 0 Votes
    1 Posts
    1 Views
    No one has replied
  • Category Partitioning

    tutorial question career
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Winforms - automated retrieve static image

    csharp winforms graphics json help
    3
    0 Votes
    3 Posts
    2 Views
    L
    You mean something similar to below code? string fileName = "C:\\Images\\2.tif"; Bitmap btm = new Bitmap(fileName); //Perform recognition result = vendor.Reader.AnalyzeField(btm); Where is the initialization-code of your _transferFile member? Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
  • Nokia for Windows Phone developers, DVLUP.

    com game-dev question
    6
    0 Votes
    6 Posts
    2 Views
    A
    This is not the right forum for posting anything else other than a question on Window Forms. (definitely not for advertising) Apps - Color Analyzer | Arctic | XKCD | Sound Meter | Speed Dial
  • 0 Votes
    2 Posts
    3 Views
    L
    I already gave you a suggestion at Dock Panels 2.7.0.0 not working[^]. Please do not post the same question in multiple forums. Veni, vidi, abiit domum
  • Code VB 2010 - Send SMS via AT command

    graphics
    2
    0 Votes
    2 Posts
    3 Views
    B
    ? A big code dump. So what? What's the problem?
  • Databinding to TextBox

    database wpf wcf question
    4
    0 Votes
    4 Posts
    5 Views
    B
    First, I think you need to add a constructor to 'adrData: public class adrData { public string label { get; set; } public adr ad { get; set; } public para pa { get; set; } // ctor public adrData() { label = ""; ad = new adr(); pa = new para(); } } Then, in code, you can do something like this: adrData newAdrData = new adrData(); newAdrData.ad.r1.name = "Route Name #1"; textBox1.DataBindings.Add("Text", newAdrData, "ad.r1.name"); To bind to a specific instance of 'adrData. Unless you create a new instance of 'ad, within 'adrData, then you never initialize the 'routes: because only creating a new instance of 'adr will initialize the 'routes. ~ “This isn't right; this isn't even wrong." Wolfgang Pauli, commenting on a physics paper submitted for a journal
  • Logging for Windows Form application

    c++ dotnet winforms question
    2
    0 Votes
    2 Posts
    5 Views
    L
    log4net is pretty popular choice, log4net Tutorial[^]
  • 0 Votes
    2 Posts
    4 Views
    L
    Member 8387808 wrote: I'm getting error Cannot insert explicit value for identity column in table 'Project_Table' when IDENTITY_INSERT is set to OFF Means you're passing in a value for the primary key - but that column is readonly, as the database will generate a value for you. Member 8387808 wrote: Another table Phases_table has dependency on Project_Table through FK constraint. Is the error because of this constraint?:confused: Can you explain me the difference between a PK and a FK? If not, no problem - we'll start there. Member 8387808 wrote: Are there any sample examples on C# with MSSQL database which use multiple windows forms with multiples table linked in an hierarchy? Yes. Now a bit more specific, or I'll have to point to a random db-application. Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
  • Thread Leak

    csharp learning c++ asp-net wpf
    10
    0 Votes
    10 Posts
    5 Views
    M
    I found the problem. It is a memory leak by design in the TextBox control. There is a feature of this box that allows you to undo a change. By default it is set to infinite. Every time you update the value in the control whether from the keyboard or from the code behind it adds to this buffer. It can be turned off completely by putting a -1 in the number of values to be buffered. This is well documented in MSDN forums but several years old. Finding the right search key that forces it to go back that far is very difficult. This is an old tread of mine I just ran across and forgot to update it when I found the answer. I hope this will help others when they do a search. So many years of programming I have forgotten more languages than I know.
  • ListBox does not update when DataSource is changed

    help question announcement
    23
    0 Votes
    23 Posts
    68 Views
    T
    Perhaps I misunderstood your problem, I thought that it was that the ListBox was not automatically reflecting changes to the underlying DataSource List. The BindingList raises events that would cause the ListBox to update automatically when the List changes. Here is a simple example. New WinForm project with two buttons and two ListBoxes. Clicking Button1 adds items to the underlying lists, but only the ListBox with the BindingList as the DataSource is update. Clicking Button2 tells ListBox1 to Refresh it's data. using System; using System.Collections.Generic; using System.ComponentModel; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } List<int> L1 = new List<int>(); BindingList<int> L2 = new BindingList<int>(); private void Form1\_Load(object sender, EventArgs e) { L1.Add(1); L1.Add(2); L2.Add(11); L2.Add(22); listBox1.DataSource = L1; listBox2.DataSource = L2; this.button1.Click += new System.EventHandler(this.button1\_Click); this.button2.Click += new System.EventHandler(this.button2\_Click); } private void button1\_Click(object sender, EventArgs e) { L1.Add(3); // adds a value to L1, but listBox1 does not display it until the binding is refresshed L2.Add(33); // adds a value to L2 and listBox2 is automatically refreshed to display it } private void button2\_Click(object sender, EventArgs e) { // tell listBox1 to refresh the data ((CurrencyManager)this.BindingContext\[L1\]).Refresh(); } } }
  • hello

    com help question
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • 0 Votes
    1 Posts
    2 Views
    No one has replied
  • Control hide/show(should be post here, right?)

    question
    7
    0 Votes
    7 Posts
    5 Views
    L
    kenmaMoon wrote: yes, but the button is in the userControl, next time I want the user control shown by click the button. Re-read what I wrote; the button will be invisible if you hide the container it's in. You cannot click an invisible button. Either put the button somewhere else and have it toggle the Visible property, or put the button somewhere on location (0,0) and resize the control to shrink to the size of the button. Third, best option; throw the button and the control you wish to show/hide on a new usercontrol. Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
  • C# Winform controls not drawing

    csharp graphics wpf design question
    2
    0 Votes
    2 Posts
    3 Views
    L
    Member 7834460 wrote: after the 20th control, the UI doesnt show anything. Does that mean that "20 items" is the maximum that "fit" on your form? It might be creating the rest of them on the non-visible area. Does it have a ScrollViewer where you put the children in? Any scrollbars set? Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
  • Slow Graphics in Windows 8

    csharp graphics winforms performance question
    5
    0 Votes
    5 Posts
    4 Views
    D
    I tried all of that months ago before posting the message, even talked to Microsoft. I also investigated graphics card issues - no change. It appears they have changed something inside the Win8 graphics kernel so that part of Aero is built-in and cannot be disabled conventionally. CQ de W5ALT Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software
  • Changing BackColor for tabControl

    4
    0 Votes
    4 Posts
    5 Views
    D
    Did you read this[^]? You'll have to custom draw the tab control yourself to change the color. A guide to posting questions on CodeProject[^] Dave Kreskowiak
  • 0 Votes
    1 Posts
    2 Views
    No one has replied
  • How to link drawings on on-line maps to the map

    csharp graphics help tutorial
    5
    0 Votes
    5 Posts
    3 Views
    B
    That's the way to go. But I do not know the functions provided by the control. Why don't you ask the author - there is a section below his article for taht purposes, isn't it?
  • 0 Votes
    4 Posts
    5 Views
    L
    Tridip Bhattacharjee wrote: what is the meaning of FWIW? FWIW is "For What It's Worth". You can build a UserControl, drop two labels and a browser on there, and you'd have something similar. Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]