{"id":22796118,"url":"https://github.com/tatsuyafujisaki/winforms-cheat-sheet","last_synced_at":"2026-05-02T19:37:12.363Z","repository":{"id":78635868,"uuid":"62238248","full_name":"tatsuyafujisaki/winforms-cheat-sheet","owner":"tatsuyafujisaki","description":null,"archived":false,"fork":false,"pushed_at":"2021-01-07T13:30:25.000Z","size":21,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-24T00:55:36.386Z","etag":null,"topics":["cheat-sheet","csharp","winforms"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tatsuyafujisaki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-29T15:45:51.000Z","updated_at":"2024-09-17T13:00:34.000Z","dependencies_parsed_at":"2023-03-26T17:22:09.173Z","dependency_job_id":null,"html_url":"https://github.com/tatsuyafujisaki/winforms-cheat-sheet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tatsuyafujisaki%2Fwinforms-cheat-sheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tatsuyafujisaki%2Fwinforms-cheat-sheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tatsuyafujisaki%2Fwinforms-cheat-sheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tatsuyafujisaki%2Fwinforms-cheat-sheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tatsuyafujisaki","download_url":"https://codeload.github.com/tatsuyafujisaki/winforms-cheat-sheet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246358322,"owners_count":20764366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cheat-sheet","csharp","winforms"],"created_at":"2024-12-12T05:10:31.717Z","updated_at":"2026-05-02T19:37:12.332Z","avatar_url":"https://github.com/tatsuyafujisaki.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build status](https://ci.appveyor.com/api/projects/status/ku6lve8st7yxy6ow?svg=true)](https://ci.appveyor.com/project/tatsuya/winforms-cheat-sheet)\n\n# Best practices\n## Form\n* `AutoSize` = `True`\n* `AutoSizeMode` = `GrowAndShrink`\n* `StartPosition` = `CenterScreen`\n  * `Form.CenterToScreen()` is not intended to be used directly from your code.\n    * https://msdn.microsoft.com/en-us/library/system.windows.forms.form.centertoscreen.aspx\n* `TopMost` = `True`\n\n## ComboBox\n* `Sorted` = `True`\n\n## DataGridView\n* `MultiSelect` = `False`\n\n## ListView\n```csharp\nliewView1.BeginUpdate();\n\nliewView1.Items.Clear();\n\n// Say, xs is defined somewhere else.\nforeach (var lvi in xs.Select(x =\u003e new ListViewItem(new[]\n{\n    x.Foo,\n    x.Bar,\n    x.Baz\n}) { Tag = x }))\n{\n    liewView1.Items.Add(lvi);\n}\n\nliewView1.AutoResizeColumns(liewView1.Items.Count == 0\n    ? ColumnHeaderAutoResizeStyle.HeaderSize\n    : ColumnHeaderAutoResizeStyle.ColumnContent);\n    \nliewView1.EndUpdate();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftatsuyafujisaki%2Fwinforms-cheat-sheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftatsuyafujisaki%2Fwinforms-cheat-sheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftatsuyafujisaki%2Fwinforms-cheat-sheet/lists"}