├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE.TXT ├── README.md ├── Solitaire.sln ├── Solitaire ├── ApplicationEvents.vb ├── CardBackDialog.Designer.vb ├── CardBackDialog.resx ├── CardBackDialog.vb ├── Common.vb ├── DealAgainDialog.Designer.vb ├── DealAgainDialog.resx ├── DealAgainDialog.vb ├── GameForm.Designer.vb ├── GameForm.resx ├── GameForm.vb ├── Ico │ ├── sol1.ico │ └── sol2.ico ├── My Project │ ├── Application.Designer.vb │ └── Application.myapp ├── OptionsDialog.Designer.vb ├── OptionsDialog.resx ├── OptionsDialog.vb ├── Png │ ├── AceSpade_0.png │ ├── AceSpade_1.png │ ├── AceSpade_2.png │ ├── AceSpade_3.png │ ├── AceSpade_4.png │ ├── AceSpade_5.png │ ├── CardBack_0.png │ ├── CardBack_1.png │ ├── CardBack_10.png │ ├── CardBack_11.png │ ├── CardBack_2.png │ ├── CardBack_3.png │ ├── CardBack_4.png │ ├── CardBack_5.png │ ├── CardBack_6.png │ ├── CardBack_7.png │ ├── CardBack_8.png │ ├── CardBack_9.png │ ├── CardSlot_0.png │ ├── CardSlot_1.png │ ├── CardSlot_2.png │ ├── Club_0.png │ ├── Club_1.png │ ├── Club_10.png │ ├── Club_11.png │ ├── Club_12.png │ ├── Club_2.png │ ├── Club_3.png │ ├── Club_4.png │ ├── Club_5.png │ ├── Club_6.png │ ├── Club_7.png │ ├── Club_8.png │ ├── Club_9.png │ ├── Diamond_0.png │ ├── Diamond_1.png │ ├── Diamond_10.png │ ├── Diamond_11.png │ ├── Diamond_12.png │ ├── Diamond_2.png │ ├── Diamond_3.png │ ├── Diamond_4.png │ ├── Diamond_5.png │ ├── Diamond_6.png │ ├── Diamond_7.png │ ├── Diamond_8.png │ ├── Diamond_9.png │ ├── Heart_0.png │ ├── Heart_1.png │ ├── Heart_10.png │ ├── Heart_11.png │ ├── Heart_12.png │ ├── Heart_2.png │ ├── Heart_3.png │ ├── Heart_4.png │ ├── Heart_5.png │ ├── Heart_6.png │ ├── Heart_7.png │ ├── Heart_8.png │ ├── Heart_9.png │ ├── Spade_0.png │ ├── Spade_1.png │ ├── Spade_10.png │ ├── Spade_11.png │ ├── Spade_12.png │ ├── Spade_2.png │ ├── Spade_3.png │ ├── Spade_4.png │ ├── Spade_5.png │ ├── Spade_6.png │ ├── Spade_7.png │ ├── Spade_8.png │ └── Spade_9.png └── Solitaire.vbproj ├── sol.ico └── solitaire.png /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: dualbrain 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | -------------------------------------------------------------------------------- /LICENSE.TXT: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Cory Smith 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Solitaire 2 | 3 | A clone of Microsoft Windows Solitaire (in VB.NET / .NET 8). 4 | 5 | ![Solitaire](solitaire.png) 6 | 7 | This version pays tribute to arguably the most played game... ever. 8 | 9 | The project represents the *revisited* version; where it has been completely reworked, ported, improved and adjusted for compiling/running on .NET 8. 10 | 11 | The simplest way to get started with the code is to use [Microsoft Visual Studio 2022 Community Edition](https://visualstudio.microsoft.com/free-developer-offers/) (It's FREE!). 12 | 13 | This work is inspired, in part, by the C# version that was originally made available on GotDotNet. After working through to convert this code (circa 2004-2005) to VB.NET, fixing several bugs and adding missing features, it was published to [AddressOf.com](http://addressof.com/posts/solitaire-written-in-vb-net/). 14 | 15 | The following information is taken from the original announcement. 16 | 17 | Here's a quick list of some (original) improvements: 18 | 19 | - Added XP Visual Styles support. 20 | - Added persistent storage (code is capable of using Windows logo compliant storage or Isolated storage) 21 | - Fixed: When less than three cards remaining on the left and then clicking to see them, some cards from below in the pile show through. 22 | - Added context help on the dialogs and integration with the associated Windows help files (Not sure if this will work on Windows 98 or not). 23 | - Added checking the minimum size to the main window. 24 | - Added persisting location and size of the main window. 25 | 26 | Since that time... 27 | 28 | - Ported to .NET 8. 29 | - Cleaned up all code to fit the more modern (evolved) coding style. 30 | - Addressed issues reported in VS 2022. 31 | 32 | Additionally, I'd like to give credit to the following for their work on the C# version that this is inspired: Christine Morin and Chris Sells. 33 | 34 | Unfortunately, the original C# version may be lost to history after the closure of GotDotNet. :-( 35 | 36 | ## Discord 37 | 38 | Please reach out to me on Discord: 39 | 40 | - [Discord Invite](https://discord.gg/Y8EH5fF6WG) 41 | 42 | ## In the News 43 | 44 | [Microsoft Solitaire Is Finally 'Hall of Fame' Status and It's Far More Important Than Anyone Realizes](https://www.inc.com/don-reisinger/microsoft-solitaire-is-finally-hall-of-fame-status-its-far-more-important-than-anyone-realizes.html) A legendary gaming classic proves simplicity matters. 45 | 46 | [Bing News - Solitaire](https://www.bing.com/news/search?q=Solitaire&qpvt=solitaire&FORM=EWRE) 47 | -------------------------------------------------------------------------------- /Solitaire.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio Version 17 3 | VisualStudioVersion = 17.2.32526.322 4 | MinimumVisualStudioVersion = 10.0.40219.1 5 | Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Solitaire", "Solitaire\Solitaire.vbproj", "{78B3A22A-23E7-435C-B386-3EDDA9CC38FC}" 6 | EndProject 7 | Global 8 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 9 | Debug|Any CPU = Debug|Any CPU 10 | Release|Any CPU = Release|Any CPU 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {31532B94-3325-4F16-8968-305EFF73D491}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 14 | {31532B94-3325-4F16-8968-305EFF73D491}.Debug|Any CPU.Build.0 = Debug|Any CPU 15 | {31532B94-3325-4F16-8968-305EFF73D491}.Release|Any CPU.ActiveCfg = Release|Any CPU 16 | {31532B94-3325-4F16-8968-305EFF73D491}.Release|Any CPU.Build.0 = Release|Any CPU 17 | {78B3A22A-23E7-435C-B386-3EDDA9CC38FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 18 | {78B3A22A-23E7-435C-B386-3EDDA9CC38FC}.Debug|Any CPU.Build.0 = Debug|Any CPU 19 | {78B3A22A-23E7-435C-B386-3EDDA9CC38FC}.Release|Any CPU.ActiveCfg = Release|Any CPU 20 | {78B3A22A-23E7-435C-B386-3EDDA9CC38FC}.Release|Any CPU.Build.0 = Release|Any CPU 21 | EndGlobalSection 22 | GlobalSection(SolutionProperties) = preSolution 23 | HideSolutionNode = FALSE 24 | EndGlobalSection 25 | GlobalSection(ExtensibilityGlobals) = postSolution 26 | SolutionGuid = {8F6CCBED-936B-4EEF-8FE0-88D1A2A8B17D} 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /Solitaire/ApplicationEvents.vb: -------------------------------------------------------------------------------- 1 | Imports Microsoft.VisualBasic.ApplicationServices 2 | 3 | Namespace My 4 | ' The following events are available for MyApplication: 5 | ' Startup: Raised when the application starts, before the startup form is created. 6 | ' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally. 7 | ' UnhandledException: Raised if the application encounters an unhandled exception. 8 | ' StartupNextInstance: Raised when launching a single-instance application and the application is already active. 9 | ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected. 10 | 11 | ' **NEW** ApplyApplicationDefaults: Raised when the application queries default values to be set for the application. 12 | 13 | ' Example: 14 | ' Private Sub MyApplication_ApplyApplicationDefaults(sender As Object, e As ApplyApplicationDefaultsEventArgs) Handles Me.ApplyApplicationDefaults 15 | ' 16 | ' ' Setting the application-wide default Font: 17 | ' e.Font = New Font(FontFamily.GenericSansSerif, 12, FontStyle.Regular) 18 | ' 19 | ' ' Setting the HighDpiMode for the Application: 20 | ' e.HighDpiMode = HighDpiMode.PerMonitorV2 21 | ' 22 | ' ' If a splash dialog is used, this sets the minimum display time: 23 | ' e.MinimumSplashScreenDisplayTime = 4000 24 | ' End Sub 25 | 26 | Partial Friend Class MyApplication 27 | 28 | End Class 29 | End Namespace 30 | -------------------------------------------------------------------------------- /Solitaire/CardBackDialog.Designer.vb: -------------------------------------------------------------------------------- 1 |  _ 2 | Partial Class CardBackDialog 3 | Inherits System.Windows.Forms.Form 4 | 5 | 'Form overrides dispose to clean up the component list. 6 | _ 7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean) 8 | Try 9 | If disposing AndAlso components IsNot Nothing Then 10 | components.Dispose() 11 | End If 12 | Finally 13 | MyBase.Dispose(disposing) 14 | End Try 15 | End Sub 16 | 17 | 'Required by the Windows Form Designer 18 | Private components As System.ComponentModel.IContainer 19 | 20 | 'NOTE: The following procedure is required by the Windows Form Designer 21 | 'It can be modified using the Windows Form Designer. 22 | 'Do not modify it using the code editor. 23 | _ 24 | Private Sub InitializeComponent() 25 | Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(CardBackDialog)) 26 | Button9 = New Button() 27 | Button10 = New Button() 28 | Button11 = New Button() 29 | Button12 = New Button() 30 | Button13 = New Button() 31 | Button14 = New Button() 32 | Button8 = New Button() 33 | Button7 = New Button() 34 | Button6 = New Button() 35 | Button5 = New Button() 36 | Button4 = New Button() 37 | Button3 = New Button() 38 | CancelActionButton = New Button() 39 | OkButton = New Button() 40 | HelpProvider = New HelpProvider() 41 | SuspendLayout() 42 | ' 43 | ' Button9 44 | ' 45 | Button9.FlatStyle = FlatStyle.Flat 46 | HelpProvider.SetHelpString(Button9, "Click a card type to specify the deck you want to play the game with.") 47 | Button9.Image = CType(resources.GetObject("Button9.Image"), Image) 48 | Button9.Location = New Point(258, 92) 49 | Button9.Name = "Button9" 50 | HelpProvider.SetShowHelp(Button9, True) 51 | Button9.Size = New Size(38, 69) 52 | Button9.TabIndex = 41 53 | ' 54 | ' Button10 55 | ' 56 | Button10.FlatStyle = FlatStyle.Flat 57 | HelpProvider.SetHelpString(Button10, "Click a card type to specify the deck you want to play the game with.") 58 | Button10.Image = CType(resources.GetObject("Button10.Image"), Image) 59 | Button10.Location = New Point(210, 92) 60 | Button10.Name = "Button10" 61 | HelpProvider.SetShowHelp(Button10, True) 62 | Button10.Size = New Size(38, 69) 63 | Button10.TabIndex = 40 64 | ' 65 | ' Button11 66 | ' 67 | Button11.FlatStyle = FlatStyle.Flat 68 | HelpProvider.SetHelpString(Button11, "Click a card type to specify the deck you want to play the game with.") 69 | Button11.Image = CType(resources.GetObject("Button11.Image"), Image) 70 | Button11.Location = New Point(162, 92) 71 | Button11.Name = "Button11" 72 | HelpProvider.SetShowHelp(Button11, True) 73 | Button11.Size = New Size(38, 69) 74 | Button11.TabIndex = 39 75 | ' 76 | ' Button12 77 | ' 78 | Button12.FlatStyle = FlatStyle.Flat 79 | HelpProvider.SetHelpString(Button12, "Click a card type to specify the deck you want to play the game with.") 80 | Button12.Image = CType(resources.GetObject("Button12.Image"), Image) 81 | Button12.Location = New Point(114, 92) 82 | Button12.Name = "Button12" 83 | HelpProvider.SetShowHelp(Button12, True) 84 | Button12.Size = New Size(38, 69) 85 | Button12.TabIndex = 38 86 | ' 87 | ' Button13 88 | ' 89 | Button13.FlatStyle = FlatStyle.Flat 90 | HelpProvider.SetHelpString(Button13, "Click a card type to specify the deck you want to play the game with.") 91 | Button13.Image = CType(resources.GetObject("Button13.Image"), Image) 92 | Button13.Location = New Point(66, 92) 93 | Button13.Name = "Button13" 94 | HelpProvider.SetShowHelp(Button13, True) 95 | Button13.Size = New Size(38, 69) 96 | Button13.TabIndex = 37 97 | ' 98 | ' Button14 99 | ' 100 | Button14.FlatStyle = FlatStyle.Flat 101 | HelpProvider.SetHelpString(Button14, "Click a card type to specify the deck you want to play the game with.") 102 | Button14.Image = CType(resources.GetObject("Button14.Image"), Image) 103 | Button14.Location = New Point(18, 92) 104 | Button14.Name = "Button14" 105 | HelpProvider.SetShowHelp(Button14, True) 106 | Button14.Size = New Size(38, 69) 107 | Button14.TabIndex = 36 108 | ' 109 | ' Button8 110 | ' 111 | Button8.FlatStyle = FlatStyle.Flat 112 | HelpProvider.SetHelpString(Button8, "Click a card type to specify the deck you want to play the game with.") 113 | Button8.Image = CType(resources.GetObject("Button8.Image"), Image) 114 | Button8.Location = New Point(258, 14) 115 | Button8.Name = "Button8" 116 | HelpProvider.SetShowHelp(Button8, True) 117 | Button8.Size = New Size(38, 68) 118 | Button8.TabIndex = 35 119 | ' 120 | ' Button7 121 | ' 122 | Button7.FlatStyle = FlatStyle.Flat 123 | HelpProvider.SetHelpString(Button7, "Click a card type to specify the deck you want to play the game with.") 124 | Button7.Image = CType(resources.GetObject("Button7.Image"), Image) 125 | Button7.Location = New Point(210, 14) 126 | Button7.Name = "Button7" 127 | HelpProvider.SetShowHelp(Button7, True) 128 | Button7.Size = New Size(38, 68) 129 | Button7.TabIndex = 34 130 | ' 131 | ' Button6 132 | ' 133 | Button6.FlatStyle = FlatStyle.Flat 134 | HelpProvider.SetHelpString(Button6, "Click a card type to specify the deck you want to play the game with.") 135 | Button6.Image = CType(resources.GetObject("Button6.Image"), Image) 136 | Button6.Location = New Point(162, 14) 137 | Button6.Name = "Button6" 138 | HelpProvider.SetShowHelp(Button6, True) 139 | Button6.Size = New Size(38, 68) 140 | Button6.TabIndex = 33 141 | ' 142 | ' Button5 143 | ' 144 | Button5.FlatStyle = FlatStyle.Flat 145 | HelpProvider.SetHelpString(Button5, "Click a card type to specify the deck you want to play the game with.") 146 | Button5.Image = CType(resources.GetObject("Button5.Image"), Image) 147 | Button5.Location = New Point(114, 14) 148 | Button5.Name = "Button5" 149 | HelpProvider.SetShowHelp(Button5, True) 150 | Button5.Size = New Size(38, 68) 151 | Button5.TabIndex = 32 152 | ' 153 | ' Button4 154 | ' 155 | Button4.FlatStyle = FlatStyle.Flat 156 | HelpProvider.SetHelpString(Button4, "Click a card type to specify the deck you want to play the game with.") 157 | Button4.Image = CType(resources.GetObject("Button4.Image"), Image) 158 | Button4.Location = New Point(66, 14) 159 | Button4.Name = "Button4" 160 | HelpProvider.SetShowHelp(Button4, True) 161 | Button4.Size = New Size(38, 68) 162 | Button4.TabIndex = 31 163 | ' 164 | ' Button3 165 | ' 166 | Button3.FlatStyle = FlatStyle.Flat 167 | HelpProvider.SetHelpString(Button3, "Click a card type to specify the deck you want to play the game with.") 168 | Button3.Image = CType(resources.GetObject("Button3.Image"), Image) 169 | Button3.Location = New Point(18, 14) 170 | Button3.Name = "Button3" 171 | HelpProvider.SetShowHelp(Button3, True) 172 | Button3.Size = New Size(38, 68) 173 | Button3.TabIndex = 30 174 | ' 175 | ' CancelActionButton 176 | ' 177 | CancelActionButton.DialogResult = DialogResult.Cancel 178 | CancelActionButton.FlatStyle = FlatStyle.System 179 | HelpProvider.SetHelpString(CancelActionButton, "Closes the dialog box without saving any changes you have made.") 180 | CancelActionButton.Location = New Point(171, 181) 181 | CancelActionButton.Name = "CancelActionButton" 182 | HelpProvider.SetShowHelp(CancelActionButton, True) 183 | CancelActionButton.Size = New Size(77, 29) 184 | CancelActionButton.TabIndex = 29 185 | CancelActionButton.Text = "Cancel" 186 | ' 187 | ' OkButton 188 | ' 189 | OkButton.DialogResult = DialogResult.OK 190 | OkButton.FlatStyle = FlatStyle.System 191 | HelpProvider.SetHelpString(OkButton, "Closes the dialog box and saves any changes you have made.") 192 | OkButton.Location = New Point(75, 181) 193 | OkButton.Name = "OkButton" 194 | HelpProvider.SetShowHelp(OkButton, True) 195 | OkButton.Size = New Size(77, 29) 196 | OkButton.TabIndex = 28 197 | OkButton.Text = "OK" 198 | ' 199 | ' Form1 200 | ' 201 | AcceptButton = OkButton 202 | AutoScaleMode = AutoScaleMode.Inherit 203 | CancelButton = CancelActionButton 204 | ClientSize = New Size(314, 224) 205 | Controls.Add(Button9) 206 | Controls.Add(Button10) 207 | Controls.Add(Button11) 208 | Controls.Add(Button12) 209 | Controls.Add(Button13) 210 | Controls.Add(Button14) 211 | Controls.Add(Button8) 212 | Controls.Add(Button7) 213 | Controls.Add(Button6) 214 | Controls.Add(Button5) 215 | Controls.Add(Button4) 216 | Controls.Add(Button3) 217 | Controls.Add(CancelActionButton) 218 | Controls.Add(OkButton) 219 | FormBorderStyle = FormBorderStyle.FixedDialog 220 | HelpButton = True 221 | MaximizeBox = False 222 | MaximumSize = New Size(330, 263) 223 | MinimizeBox = False 224 | MinimumSize = New Size(330, 263) 225 | Name = "Form1" 226 | ShowInTaskbar = False 227 | StartPosition = FormStartPosition.CenterParent 228 | Text = "Select Card Back" 229 | ResumeLayout(False) 230 | End Sub 231 | 232 | Friend WithEvents Button9 As Button 233 | Friend WithEvents HelpProvider As HelpProvider 234 | Friend WithEvents Button10 As Button 235 | Friend WithEvents Button11 As Button 236 | Friend WithEvents Button12 As Button 237 | Friend WithEvents Button13 As Button 238 | Friend WithEvents Button14 As Button 239 | Friend WithEvents Button8 As Button 240 | Friend WithEvents Button7 As Button 241 | Friend WithEvents Button6 As Button 242 | Friend WithEvents Button5 As Button 243 | Friend WithEvents Button4 As Button 244 | Friend WithEvents Button3 As Button 245 | Friend WithEvents CancelActionButton As Button 246 | Friend WithEvents OkButton As Button 247 | End Class 248 | -------------------------------------------------------------------------------- /Solitaire/CardBackDialog.vb: -------------------------------------------------------------------------------- 1 | Public Class CardBackDialog 2 | 3 | Public Property Cardback() As Integer = 0 4 | 5 | Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click 6 | Cardback = 0 7 | End Sub 8 | 9 | Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click 10 | Cardback = 1 11 | End Sub 12 | 13 | Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click 14 | Cardback = 2 15 | End Sub 16 | 17 | Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click 18 | Cardback = 3 19 | End Sub 20 | 21 | Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click 22 | Cardback = 4 23 | End Sub 24 | 25 | Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click 26 | Cardback = 5 27 | End Sub 28 | 29 | Private Sub Button14_Click(sender As Object, e As EventArgs) Handles Button14.Click 30 | Cardback = 6 31 | End Sub 32 | 33 | Private Sub Button13_Click(sender As Object, e As EventArgs) Handles Button13.Click 34 | Cardback = 7 35 | End Sub 36 | 37 | Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click 38 | Cardback = 8 39 | End Sub 40 | 41 | Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click 42 | Cardback = 9 43 | End Sub 44 | 45 | Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click 46 | Cardback = 10 47 | End Sub 48 | 49 | Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click 50 | Cardback = 11 51 | End Sub 52 | 53 | End Class -------------------------------------------------------------------------------- /Solitaire/Common.vb: -------------------------------------------------------------------------------- 1 | Imports System.Environment 2 | Imports System.IO 3 | Imports System.IO.IsolatedStorage 4 | 5 | Imports System.Runtime.InteropServices 6 | 7 | Friend Class Common 8 | 9 | Friend Const EnhancedMode As Boolean = True 10 | 11 | End Class 12 | 13 | Friend Class Win32 14 | 15 | 'Private Declare Function ShellAbout Lib "shell32.dll" Alias "ShellAboutA" (hwnd As IntPtr, 16 | ' szApp As String, 17 | ' szOtherStuff As String, 18 | ' hIcon As IntPtr) As Integer 19 | 20 | 21 | Friend Shared Function ShellAbout(hWnd As IntPtr, 22 | szApp As String, 23 | szOtherStuff As String, 24 | hIcon As IntPtr) As Integer 25 | End Function 26 | 27 | End Class 28 | 29 | Friend Enum Draw 30 | One 31 | Three 32 | End Enum 33 | 34 | Friend Enum CardSuit 35 | Spades 36 | Diamonds 37 | Clubs 38 | Hearts 39 | End Enum 40 | 41 | Public Enum Scoring 42 | None 43 | Standard 44 | Vegas 45 | VegasCumulative 46 | End Enum 47 | 48 | Public Class Settings 49 | 50 | Private Const DEFAULT_FILENAME As String = "settings.xml" 51 | Private Const DEFAULT_USE_ISOLATED_STORAGE As Boolean = False 52 | 53 | Private m_cardBack As Integer = 3 ' Index of picture to use for deck back. 54 | 55 | #Region "Loading and Saving" 56 | 57 | Overloads Shared Function GetFileStreamForWriting() As Stream 58 | Return GetFileStreamForWriting(DEFAULT_FILENAME, DEFAULT_USE_ISOLATED_STORAGE) 59 | End Function 60 | 61 | Overloads Shared Function GetFileStreamForWriting(filename As String) As Stream 62 | Return GetFileStreamForWriting(filename, DEFAULT_USE_ISOLATED_STORAGE) 63 | End Function 64 | 65 | Overloads Shared Function GetFileStreamForWriting(filename As String, useIsolatedStorage As Boolean) As Stream 66 | If useIsolatedStorage Then 67 | Using isf = IsolatedStorageFile.GetUserStoreForAssembly() 68 | Try 69 | Return New IsolatedStorageFileStream(filename, FileMode.Create, FileAccess.Write, FileShare.None, isf) 70 | Finally 71 | isf.Close() 72 | End Try 73 | End Using 74 | Else 75 | Dim workingPath = Path.Combine(GetFolderPath(SpecialFolder.LocalApplicationData), Application.CompanyName) 76 | workingPath = Path.Combine(workingPath, Application.ProductName) 77 | If Not Directory.Exists(workingPath) Then Directory.CreateDirectory(workingPath) 78 | workingPath = IO.Path.Combine(workingPath, filename) 79 | Return New FileStream(workingPath, FileMode.Create, FileAccess.Write, FileShare.None) 80 | End If 81 | End Function 82 | 83 | Overloads Shared Function GetFileStreamForReading() As Stream 84 | Return GetFileStreamForReading(DEFAULT_FILENAME, DEFAULT_USE_ISOLATED_STORAGE) 85 | End Function 86 | 87 | Overloads Shared Function GetFileStreamForReading(filename As String) As Stream 88 | Return GetFileStreamForReading(filename, DEFAULT_USE_ISOLATED_STORAGE) 89 | End Function 90 | 91 | Overloads Shared Function GetFileStreamForReading(filename As String, useIsolatedStorage As Boolean) As Stream 92 | If useIsolatedStorage Then 93 | Using isf = IsolatedStorageFile.GetUserStoreForAssembly() 94 | Try 95 | Return New IsolatedStorageFileStream(filename, FileMode.OpenOrCreate, FileAccess.Read, FileShare.Read, isf) 96 | Finally 97 | isf.Close() 98 | End Try 99 | End Using 100 | Else 101 | Dim workingPath = Path.Combine(GetFolderPath(SpecialFolder.LocalApplicationData), Application.CompanyName) 102 | workingPath = Path.Combine(workingPath, Application.ProductName) 103 | If Not Directory.Exists(workingPath) Then Directory.CreateDirectory(workingPath) 104 | workingPath = Path.Combine(workingPath, filename) 105 | Return New FileStream(workingPath, FileMode.OpenOrCreate, FileAccess.Read, FileShare.Read) 106 | End If 107 | End Function 108 | 109 | Shared Sub Persist(settings As Settings) 110 | Try 111 | Dim outputStream = GetFileStreamForWriting() 112 | Persist(settings, outputStream) 113 | Catch ex As Exception 114 | Throw New Exception("Could not save Settings", ex) 115 | End Try 116 | End Sub 117 | 118 | Shared Sub Persist(settings As Settings, outputStream As Stream) 119 | Try 120 | Dim xs = New Xml.Serialization.XmlSerializer(GetType(Settings)) 121 | xs.Serialize(outputStream, settings) 122 | Finally 123 | outputStream.Close() 124 | End Try 125 | End Sub 126 | 127 | Public Sub PersistMe() 128 | Settings.Persist(Me) 129 | End Sub 130 | 131 | Public Sub PersistMe(stream As Stream) 132 | Settings.Persist(Me, stream) 133 | End Sub 134 | 135 | Shared Function Load() As Settings 136 | Try 137 | Dim inputStream = GetFileStreamForReading() 138 | Return Load(inputStream) 139 | Catch ex As Exception 140 | Throw New Exception("Could not load Settings", ex) 141 | End Try 142 | End Function 143 | 144 | Shared Function Load(stream As Stream) As Settings 145 | Dim result As Settings 146 | Try 147 | If stream.Length = 0 Then 148 | result = New Settings 149 | Else 150 | Dim xs = New Xml.Serialization.XmlSerializer(GetType(Settings)) 151 | result = CType(xs.Deserialize(stream), Settings) 152 | End If 153 | Finally 154 | stream.Close() 155 | End Try 156 | Return result 157 | End Function 158 | 159 | #End Region 160 | 161 | ''' 162 | ''' Location of the main window. 163 | ''' 164 | ''' 165 | Public Property Location() As Point 166 | 167 | ''' 168 | ''' Size of the main window. 169 | ''' 170 | ''' 171 | Public Property Size() As Size 172 | 173 | Public Property CardBack() As Integer 174 | Get 175 | Return m_cardBack 176 | End Get 177 | Set(value As Integer) 178 | If value > -1 AndAlso value < 12 Then 179 | m_cardBack = value 180 | Else 181 | Throw New ArgumentException("Invalid CardBack specified. Valid range is 0 to 11.") 182 | End If 183 | End Set 184 | End Property 185 | 186 | ''' 187 | ''' True when drawing one card not 3. 188 | ''' 189 | ''' 190 | Public Property DrawOne() As Boolean = False 191 | 192 | ''' 193 | ''' True when outline dragging. 194 | ''' 195 | ''' 196 | Public Property Outline() As Boolean = False 197 | 198 | ''' 199 | ''' None, standard, vegas or vegas cumulative. 200 | ''' 201 | ''' 202 | Public Property Scoring() As Scoring = Scoring.Standard 203 | 204 | ''' 205 | ''' True if game is timed. 206 | ''' 207 | ''' 208 | Public Property TimedGame() As Boolean = True 209 | 210 | ''' 211 | ''' True if the status bar is visible. 212 | ''' 213 | ''' 214 | Public Property ViewStatusBar() As Boolean = True 215 | 216 | End Class -------------------------------------------------------------------------------- /Solitaire/DealAgainDialog.Designer.vb: -------------------------------------------------------------------------------- 1 |  _ 2 | Partial Class DealAgainDialog 3 | Inherits System.Windows.Forms.Form 4 | 5 | 'Form overrides dispose to clean up the component list. 6 | _ 7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean) 8 | Try 9 | If disposing AndAlso components IsNot Nothing Then 10 | components.Dispose() 11 | End If 12 | Finally 13 | MyBase.Dispose(disposing) 14 | End Try 15 | End Sub 16 | 17 | 'Required by the Windows Form Designer 18 | Private components As System.ComponentModel.IContainer 19 | 20 | 'NOTE: The following procedure is required by the Windows Form Designer 21 | 'It can be modified using the Windows Form Designer. 22 | 'Do not modify it using the code editor. 23 | _ 24 | Private Sub InitializeComponent() 25 | Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(DealAgainDialog)) 26 | Label = New Label() 27 | NoButton = New Button() 28 | PictureBox = New PictureBox() 29 | YesButton = New Button() 30 | CType(PictureBox, ComponentModel.ISupportInitialize).BeginInit() 31 | SuspendLayout() 32 | ' 33 | ' Label 34 | ' 35 | Label.FlatStyle = FlatStyle.System 36 | Label.Location = New Point(77, 27) 37 | Label.Name = "Label" 38 | Label.Size = New Size(96, 29) 39 | Label.TabIndex = 11 40 | Label.Text = "Deal Again?" 41 | ' 42 | ' NoButton 43 | ' 44 | NoButton.DialogResult = DialogResult.No 45 | NoButton.FlatStyle = FlatStyle.System 46 | NoButton.Location = New Point(112, 76) 47 | NoButton.Name = "NoButton" 48 | NoButton.Size = New Size(86, 29) 49 | NoButton.TabIndex = 10 50 | NoButton.Text = "&No" 51 | ' 52 | ' PictureBox 53 | ' 54 | PictureBox.BackgroundImage = CType(resources.GetObject("PictureBox.BackgroundImage"), Image) 55 | PictureBox.Location = New Point(32, 15) 56 | PictureBox.Name = "PictureBox" 57 | PictureBox.Size = New Size(34, 35) 58 | PictureBox.TabIndex = 9 59 | PictureBox.TabStop = False 60 | ' 61 | ' YesButton 62 | ' 63 | YesButton.DialogResult = DialogResult.Yes 64 | YesButton.FlatStyle = FlatStyle.System 65 | YesButton.Location = New Point(16, 76) 66 | YesButton.Name = "YesButton" 67 | YesButton.Size = New Size(86, 29) 68 | YesButton.TabIndex = 8 69 | YesButton.Text = "&Yes" 70 | ' 71 | ' DealAgainDialog 72 | ' 73 | AcceptButton = YesButton 74 | AutoScaleMode = AutoScaleMode.Inherit 75 | CancelButton = NoButton 76 | ClientSize = New Size(214, 121) 77 | Controls.Add(Label) 78 | Controls.Add(NoButton) 79 | Controls.Add(PictureBox) 80 | Controls.Add(YesButton) 81 | FormBorderStyle = FormBorderStyle.FixedDialog 82 | MaximizeBox = False 83 | MinimizeBox = False 84 | Name = "DealAgainDialog" 85 | ShowInTaskbar = False 86 | StartPosition = FormStartPosition.CenterParent 87 | Text = "'Classic' Solitaire" 88 | CType(PictureBox, ComponentModel.ISupportInitialize).EndInit() 89 | ResumeLayout(False) 90 | End Sub 91 | 92 | Friend WithEvents Label As Label 93 | Friend WithEvents NoButton As Button 94 | Friend WithEvents PictureBox As PictureBox 95 | Friend WithEvents YesButton As Button 96 | End Class 97 | -------------------------------------------------------------------------------- /Solitaire/DealAgainDialog.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | 123 | Qk3SDwAAAAAAADYAAAAoAAAAIwAAACUAAAABABgAAAAAAAAAAADEDgAAxA4AAAAAAAAAAAAA2Ons2Ons 124 | 2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons 125 | 2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons2Ons2Ons2Ons2Ons 126 | 2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons 127 | 2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons 128 | 2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons 129 | 2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons 130 | 2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons 131 | 2OnsAAAA2Ons2Ons2Ons2OnszdDRsp6esp+fs6Gis6Gis6Kis6Kis6Gis6Kis6Kis6Kis6Gis6Kis6Ki 132 | s6Gis6Gis6Kis6Kis6Gis6Gis6Kis6Gis6Gis6Gir5+htaut1eTm2Ons2Ons2Ons2OnsAAAA2Ons2Ons 133 | 2Onsr62uazk8YC8xYDAyYDAyYDAyYDAyYDAyYDAyYDAyXzAyXzAyXzAyXzAyXzAyYDAyYDAyYDAyYDAy 134 | YDAyYDAyYDAyYDAxXTI1YS4vchQOah0ahFdW1OPl2Ons2Ons2OnsAAAA2Ons2OnsOsXnALDaAqXLAaTN 135 | AKbNAKTNAKTNAKTNAKTNAKbNAKTNAKXOAKbPAKfPAKXOAKXOAKbNAKbNAKTNAKTNAKbNAKTNAKTNAKXO 136 | AKrWArLdNmuBcxIMaSAdrp+h2Ons2Ons2OnsAAAA2OnsY9PuAK3VALHaALTeALPfALPfALPfALPfALPf 137 | ALPfALPfALXhALrlAMr6AMv8AMHxALbiALTgALPfALPfALPfALPfALPfALPeALTgALjjAMDvAM//UUdQ 138 | bxcRpZGR2Ons2Ons2OnsAAAA2OnsJ8fpALXeALrlAcTxAMf2Acf1Acn1Acn1Acf1Acn1Acr3ANH/ANn/ 139 | IWmDVmF3PZezANL/AMv5AMn2Acn1Acf1Acn1Acj1AMj2AMj3AMTxAMHvANP/M3aMcQ8Gw8LF2Ons2Ons 140 | 2OnsAAAA2OnsW9bwALjiAMDrBNT/BNn/Adb/Adb/Adb/Adb/Adb/Adn/AOf/GDpNFwAAYwUX/7K+T524 141 | AOX/ANf/Adb/Adb/Adb/AdX/Adb/DOD/B9X/AMj1ANf/Tk5YhUM+2Ons2Ons2Ons2OnsAAAA2OnsqOPu 142 | AL3lAMHpB9H8DeP/ANb/ANP/ANT/ANT/ANT/ANj/AOD/BAAAEwAAYRoxbwseXWJ9AO3/ANb/ANT/ANT/ 143 | ANP/ANP/Bdr/HfD/Btb8AM78AMfybhkVr6Ci2Ons2Ons2Ons2OnsAAAA2Ons2OnsHcvtAMDmAMnxEOP/ 144 | Bt3/ANX/ANT/ANb/ANb/ANr/AOj/ERkkAAAAGQAAMgAAIV15APD/ANf/ANb/ANX/ANX/ANX/FOn/G+7/ 145 | AMz5AOH/NnSEhTQw1eTm2Ons2Ons2Ons2OnsAAAA2Ons2OnshODvAL/kAMbsCtv+Eej/ANn/ANf/ANf/ 146 | ANj/ANr/AOr/BqjJEQAABwAAIBknANX8AOH/ANn/ANj/ANf/ANX/A9z/Jfz/Ct//ANP/AM71Yy0tqpKQ 147 | 2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons2OnsBcfrAMXnAtD3FOz/CeP/ANn/ANn/ANr/ANv/AN7/AOz/ 148 | AO3/APX/AOv/AOj/ANz/ANr/ANv/ANn/ANf/GfL/Jf3/ANT9AOL/KYmehS8n1ubp2Ons2Ons2Ons2Ons 149 | 2OnsAAAA2Ons2Ons2Onsg+LwAMfoAMrtDN/+Eu7/Ad3/ANv/ANv/ANz/AN3/AOH/AOT/Ep+/AOX/AOH/ 150 | ANz/ANv/AN3/ANj/BuL/Kf//C+T/ANb8AN3/ZCkospuc2Ons2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons 151 | 2Ons2OnsGdHuAMnoANLzEe3/Cef/AN3/AN3/AN7/AN//AOX/A9f4QxAdAN//AOj/AN7/AN3/AN3/ANz/ 152 | Gff/Hfn/ANT6AOj/MYCQhzcx1uXo2Ons2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons2Ons2OnsiOPxAMrm 153 | AM3sB+H8EfH/AeH/AN//AN//AOH/APH/DKvGSwAHAsrsAO//AOH/AN//AN3/B+b/JP//BuL/AN3/ANXz 154 | YiwrsJiZ2Ons2Ons2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons2Ons2Ons2OnsDtTtAMvnANXyEO7/COr/ 155 | AOL/AOP/AOT/AP7/HXuMagAABq7OAPn/AOT/AOH/AOH/Fvf/G/n/ANf5AOn/LYmWgy0o1ubp2Ons2Ons 156 | 2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons2Ons2Ons2Onsh+TwAMrkAM/pCOX8DfL/AOT/AOX/AOj/AP// 157 | HkRYfAAAFpGqAPr/AOb/AOP/BOf/Hv//COj+ANv4AOP/ZSckq5SV2Ons2Ons2Ons2Ons2Ons2Ons2Ons 158 | 2OnsAAAA2Ons2Ons2Ons2Ons2Ons2OnsE9PpAM7mAdnzEPX/Ber/AOb/APH/AOj/JBcnultpMlBkAPX/ 159 | AOn/AOT/DvT/Hv//AN76AO//LomVgy0m09/h2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons 160 | 2Ons2Ons2Ons2Onsd+TvAM7kANXtDe7/Dfb/AOj/AP3/ALzQIgAAkkBQTjFEAPr/AO3/AOn/Hv//E/X/ 161 | AOL/AOH5YDIyqY6N2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons2Ons2Ons2Ons2Ons 162 | 2OnsBNXqANToBOX4E/v/A/D/AP//AaO0LQAAaCE3Tyc9AszjAPf/DPf/Jf//AOf/APH/KZSfhR0c0uDj 163 | 2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons2Ons2Ons2Ons2Ons2OnseObwANLlANvx 164 | Dvb/Df7/AP//DE5aLwAASggeRwIaE46lAP//Hv//Ffn/AOX7APL/YjAvqYeG2Ons2Ons2Ons2Ons2Ons 165 | 2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnsC9nrANjoA+j6E///Av//BgoQ 166 | HQAAPgAVQQAAIlVtA///JP//AO3/APf/JpulgyAez9rc2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons 167 | 2OnsAAAA2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnsaefxANfmAODwDv//C///AQAAFAAARAAYQwAAKzxQ 168 | Ff//Fv//AOz/APP/WT9BqH182Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons 169 | 2Ons2Ons2Ons2Ons2Ons2Ons2OnsAN3pAN3qA/D/E///BgAACQAAMAAKMQAALk1cHv//APP/APr/IKiy 170 | fxUTz9rc2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons2Ons2Ons2Ons2Ons 171 | 2Ons2Ons2OnsaunwANrmAOb0Dv//EaanAQAAAAAACAAAI+LjE///APD8APv/WEBAonZ12Ons2Ons2Ons 172 | 2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons1ejr 173 | AuLqAODpA/X/E///A/f+ArjDCv//I///Afj/AP//Ha+0fhgVytLU2Ons2Ons2Ons2Ons2Ons2Ons2Ons 174 | 2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnsX+rxAN/nAOjxDv// 175 | Cf//AP//HP//Fv//APT/AP7/VEhJom5u2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons 176 | 2OnsAAAA2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnsAOPpAOTpBPT5Ef//Cf//KP//APj+ 177 | AP//GLq/dg8LzNLV2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons 178 | 2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnsYOzxAOHlAO3yGP//Mf//If//APX6AP//VEpKmmlo2Ons 179 | 2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons2Ons2Ons2Ons2Ons 180 | 2Ons2Ons2Ons2Ons2Onsy+nsAOfqAOnrF/3+aP//Df7/AP//FcXGehMSyMrN2Ons2Ons2Ons2Ons2Ons 181 | 2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons 182 | 2Ons2OnsVe7xAOrqA/r9LP//AP//AP//T1NRrIiI2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons 183 | 2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons1OnsAPPz 184 | APf4AP//AP//I8vLspWX2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons 185 | 2OnsAAAA2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnsuezuD/7+B///O/n60+Hk 186 | 2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons 187 | 2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnszertmfDy2Ons2Ons2Ons2Ons2Ons2Ons 188 | 2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnsAAAA2Ons2Ons2Ons2Ons2Ons2Ons 189 | 2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons 190 | 2Ons2Ons2Ons2Ons2Ons2Ons2Ons2Ons2OnsAAAA 191 | 192 | 193 | -------------------------------------------------------------------------------- /Solitaire/DealAgainDialog.vb: -------------------------------------------------------------------------------- 1 | Public Class DealAgainDialog 2 | 3 | End Class -------------------------------------------------------------------------------- /Solitaire/GameForm.Designer.vb: -------------------------------------------------------------------------------- 1 |  2 | Partial Class GameForm 3 | Inherits System.Windows.Forms.Form 4 | 5 | 'Form overrides dispose to clean up the component list. 6 | 7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean) 8 | Try 9 | If disposing AndAlso components IsNot Nothing Then 10 | components.Dispose() 11 | End If 12 | Finally 13 | MyBase.Dispose(disposing) 14 | End Try 15 | End Sub 16 | 17 | 'Required by the Windows Form Designer 18 | Private components As System.ComponentModel.IContainer 19 | 20 | 'NOTE: The following procedure is required by the Windows Form Designer 21 | 'It can be modified using the Windows Form Designer. 22 | 'Do not modify it using the code editor. 23 | 24 | Private Sub InitializeComponent() 25 | components = New ComponentModel.Container() 26 | Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(GameForm)) 27 | ScoreToolStripStatusLabel = New ToolStripStatusLabel() 28 | CardSlotsImageList = New ImageList(components) 29 | AceSpadesImageList = New ImageList(components) 30 | MenuStrip1 = New MenuStrip() 31 | FileToolStripMenuItem = New ToolStripMenuItem() 32 | CheatWinToolStripMenuItem = New ToolStripMenuItem() 33 | DealToolStripMenuItem = New ToolStripMenuItem() 34 | ToolStripSeparator1 = New ToolStripSeparator() 35 | UndoToolStripMenuItem = New ToolStripMenuItem() 36 | DeckToolStripMenuItem = New ToolStripMenuItem() 37 | OptionsToolStripMenuItem = New ToolStripMenuItem() 38 | ToolStripSeparator2 = New ToolStripSeparator() 39 | ExitToolStripMenuItem = New ToolStripMenuItem() 40 | HelpToolStripMenuItem = New ToolStripMenuItem() 41 | ContentsToolStripMenuItem = New ToolStripMenuItem() 42 | SearchToolStripMenuItem = New ToolStripMenuItem() 43 | HowToUseToolStripMenuItem = New ToolStripMenuItem() 44 | ToolStripSeparator5 = New ToolStripSeparator() 45 | AboutToolStripMenuItem = New ToolStripMenuItem() 46 | HeartsImageList = New ImageList(components) 47 | GameStatusStrip = New StatusStrip() 48 | InfoToolStripStatusLabel = New ToolStripStatusLabel() 49 | TimeToolStripStatusLabel = New ToolStripStatusLabel() 50 | CardBacksImageList = New ImageList(components) 51 | StackPictureBox_6 = New PictureBox() 52 | StackPictureBox_5 = New PictureBox() 53 | StackPictureBox_4 = New PictureBox() 54 | StackPictureBox_2 = New PictureBox() 55 | StackPictureBox_1 = New PictureBox() 56 | StackPictureBox_0 = New PictureBox() 57 | AcePictureBox_1 = New PictureBox() 58 | AcePictureBox_0 = New PictureBox() 59 | DeckToDealPictureBox = New PictureBox() 60 | SpadesImageList = New ImageList(components) 61 | ClubsImageList = New ImageList(components) 62 | StackPictureBox_3 = New PictureBox() 63 | AcePictureBox_3 = New PictureBox() 64 | DropPanelPictureBox = New PictureBox() 65 | GameTimer = New Timer(components) 66 | DragBoxPictureBox_1 = New PictureBox() 67 | DiamondsImageList = New ImageList(components) 68 | DragBoxPictureBox_4 = New PictureBox() 69 | DragBoxPictureBox_3 = New PictureBox() 70 | DragBoxPictureBox_2 = New PictureBox() 71 | AcePictureBox_2 = New PictureBox() 72 | MenuStrip1.SuspendLayout() 73 | GameStatusStrip.SuspendLayout() 74 | CType(StackPictureBox_6, ComponentModel.ISupportInitialize).BeginInit() 75 | CType(StackPictureBox_5, ComponentModel.ISupportInitialize).BeginInit() 76 | CType(StackPictureBox_4, ComponentModel.ISupportInitialize).BeginInit() 77 | CType(StackPictureBox_2, ComponentModel.ISupportInitialize).BeginInit() 78 | CType(StackPictureBox_1, ComponentModel.ISupportInitialize).BeginInit() 79 | CType(StackPictureBox_0, ComponentModel.ISupportInitialize).BeginInit() 80 | CType(AcePictureBox_1, ComponentModel.ISupportInitialize).BeginInit() 81 | CType(AcePictureBox_0, ComponentModel.ISupportInitialize).BeginInit() 82 | CType(DeckToDealPictureBox, ComponentModel.ISupportInitialize).BeginInit() 83 | CType(StackPictureBox_3, ComponentModel.ISupportInitialize).BeginInit() 84 | CType(AcePictureBox_3, ComponentModel.ISupportInitialize).BeginInit() 85 | CType(DropPanelPictureBox, ComponentModel.ISupportInitialize).BeginInit() 86 | CType(DragBoxPictureBox_1, ComponentModel.ISupportInitialize).BeginInit() 87 | CType(DragBoxPictureBox_4, ComponentModel.ISupportInitialize).BeginInit() 88 | CType(DragBoxPictureBox_3, ComponentModel.ISupportInitialize).BeginInit() 89 | CType(DragBoxPictureBox_2, ComponentModel.ISupportInitialize).BeginInit() 90 | CType(AcePictureBox_2, ComponentModel.ISupportInitialize).BeginInit() 91 | SuspendLayout() 92 | ' 93 | ' ScoreToolStripStatusLabel 94 | ' 95 | ScoreToolStripStatusLabel.Name = "ScoreToolStripStatusLabel" 96 | ScoreToolStripStatusLabel.Size = New Size(48, 17) 97 | ScoreToolStripStatusLabel.Text = "Score: 0" 98 | ' 99 | ' CardSlotsImageList 100 | ' 101 | CardSlotsImageList.ColorDepth = ColorDepth.Depth16Bit 102 | CardSlotsImageList.ImageStream = CType(resources.GetObject("CardSlotsImageList.ImageStream"), ImageListStreamer) 103 | CardSlotsImageList.TransparentColor = Color.Transparent 104 | CardSlotsImageList.Images.SetKeyName(0, "") 105 | CardSlotsImageList.Images.SetKeyName(1, "") 106 | CardSlotsImageList.Images.SetKeyName(2, "") 107 | ' 108 | ' AceSpadesImageList 109 | ' 110 | AceSpadesImageList.ColorDepth = ColorDepth.Depth8Bit 111 | AceSpadesImageList.ImageStream = CType(resources.GetObject("AceSpadesImageList.ImageStream"), ImageListStreamer) 112 | AceSpadesImageList.TransparentColor = Color.Transparent 113 | AceSpadesImageList.Images.SetKeyName(0, "") 114 | AceSpadesImageList.Images.SetKeyName(1, "") 115 | AceSpadesImageList.Images.SetKeyName(2, "") 116 | AceSpadesImageList.Images.SetKeyName(3, "") 117 | AceSpadesImageList.Images.SetKeyName(4, "") 118 | AceSpadesImageList.Images.SetKeyName(5, "") 119 | ' 120 | ' MenuStrip1 121 | ' 122 | MenuStrip1.Items.AddRange(New ToolStripItem() {FileToolStripMenuItem, HelpToolStripMenuItem}) 123 | MenuStrip1.Location = New Point(0, 0) 124 | MenuStrip1.Name = "MenuStrip1" 125 | MenuStrip1.Size = New Size(694, 24) 126 | MenuStrip1.TabIndex = 18 127 | MenuStrip1.Text = "MenuStrip1" 128 | ' 129 | ' FileToolStripMenuItem 130 | ' 131 | FileToolStripMenuItem.DropDownItems.AddRange(New ToolStripItem() {CheatWinToolStripMenuItem, DealToolStripMenuItem, ToolStripSeparator1, UndoToolStripMenuItem, DeckToolStripMenuItem, OptionsToolStripMenuItem, ToolStripSeparator2, ExitToolStripMenuItem}) 132 | FileToolStripMenuItem.Name = "FileToolStripMenuItem" 133 | FileToolStripMenuItem.Size = New Size(50, 20) 134 | FileToolStripMenuItem.Text = "&Game" 135 | ' 136 | ' CheatWinToolStripMenuItem 137 | ' 138 | CheatWinToolStripMenuItem.Name = "CheatWinToolStripMenuItem" 139 | CheatWinToolStripMenuItem.Size = New Size(137, 22) 140 | CheatWinToolStripMenuItem.Text = "Cheat - Win" 141 | ' 142 | ' DealToolStripMenuItem 143 | ' 144 | DealToolStripMenuItem.Name = "DealToolStripMenuItem" 145 | DealToolStripMenuItem.Size = New Size(137, 22) 146 | DealToolStripMenuItem.Text = "&Deal" 147 | ' 148 | ' ToolStripSeparator1 149 | ' 150 | ToolStripSeparator1.Name = "ToolStripSeparator1" 151 | ToolStripSeparator1.Size = New Size(134, 6) 152 | ' 153 | ' UndoToolStripMenuItem 154 | ' 155 | UndoToolStripMenuItem.Name = "UndoToolStripMenuItem" 156 | UndoToolStripMenuItem.Size = New Size(137, 22) 157 | UndoToolStripMenuItem.Text = "&Undo" 158 | ' 159 | ' DeckToolStripMenuItem 160 | ' 161 | DeckToolStripMenuItem.Name = "DeckToolStripMenuItem" 162 | DeckToolStripMenuItem.Size = New Size(137, 22) 163 | DeckToolStripMenuItem.Text = "De&ck..." 164 | ' 165 | ' OptionsToolStripMenuItem 166 | ' 167 | OptionsToolStripMenuItem.Name = "OptionsToolStripMenuItem" 168 | OptionsToolStripMenuItem.Size = New Size(137, 22) 169 | OptionsToolStripMenuItem.Text = "&Options..." 170 | ' 171 | ' ToolStripSeparator2 172 | ' 173 | ToolStripSeparator2.Name = "ToolStripSeparator2" 174 | ToolStripSeparator2.Size = New Size(134, 6) 175 | ' 176 | ' ExitToolStripMenuItem 177 | ' 178 | ExitToolStripMenuItem.Name = "ExitToolStripMenuItem" 179 | ExitToolStripMenuItem.Size = New Size(137, 22) 180 | ExitToolStripMenuItem.Text = "E&xit" 181 | ' 182 | ' HelpToolStripMenuItem 183 | ' 184 | HelpToolStripMenuItem.DropDownItems.AddRange(New ToolStripItem() {ContentsToolStripMenuItem, SearchToolStripMenuItem, HowToUseToolStripMenuItem, ToolStripSeparator5, AboutToolStripMenuItem}) 185 | HelpToolStripMenuItem.Name = "HelpToolStripMenuItem" 186 | HelpToolStripMenuItem.Size = New Size(44, 20) 187 | HelpToolStripMenuItem.Text = "&Help" 188 | ' 189 | ' ContentsToolStripMenuItem 190 | ' 191 | ContentsToolStripMenuItem.Name = "ContentsToolStripMenuItem" 192 | ContentsToolStripMenuItem.Size = New Size(206, 22) 193 | ContentsToolStripMenuItem.Text = "&Contents" 194 | ' 195 | ' SearchToolStripMenuItem 196 | ' 197 | SearchToolStripMenuItem.Name = "SearchToolStripMenuItem" 198 | SearchToolStripMenuItem.Size = New Size(206, 22) 199 | SearchToolStripMenuItem.Text = "&Search for Help on..." 200 | ' 201 | ' HowToUseToolStripMenuItem 202 | ' 203 | HowToUseToolStripMenuItem.Name = "HowToUseToolStripMenuItem" 204 | HowToUseToolStripMenuItem.Size = New Size(206, 22) 205 | HowToUseToolStripMenuItem.Text = "&How to Use Help" 206 | ' 207 | ' ToolStripSeparator5 208 | ' 209 | ToolStripSeparator5.Name = "ToolStripSeparator5" 210 | ToolStripSeparator5.Size = New Size(203, 6) 211 | ' 212 | ' AboutToolStripMenuItem 213 | ' 214 | AboutToolStripMenuItem.Name = "AboutToolStripMenuItem" 215 | AboutToolStripMenuItem.Size = New Size(206, 22) 216 | AboutToolStripMenuItem.Text = "&About 'Classic' Solitaire..." 217 | ' 218 | ' HeartsImageList 219 | ' 220 | HeartsImageList.ColorDepth = ColorDepth.Depth16Bit 221 | HeartsImageList.ImageStream = CType(resources.GetObject("HeartsImageList.ImageStream"), ImageListStreamer) 222 | HeartsImageList.TransparentColor = Color.Blue 223 | HeartsImageList.Images.SetKeyName(0, "") 224 | HeartsImageList.Images.SetKeyName(1, "") 225 | HeartsImageList.Images.SetKeyName(2, "") 226 | HeartsImageList.Images.SetKeyName(3, "") 227 | HeartsImageList.Images.SetKeyName(4, "") 228 | HeartsImageList.Images.SetKeyName(5, "") 229 | HeartsImageList.Images.SetKeyName(6, "") 230 | HeartsImageList.Images.SetKeyName(7, "") 231 | HeartsImageList.Images.SetKeyName(8, "") 232 | HeartsImageList.Images.SetKeyName(9, "") 233 | HeartsImageList.Images.SetKeyName(10, "") 234 | HeartsImageList.Images.SetKeyName(11, "") 235 | HeartsImageList.Images.SetKeyName(12, "") 236 | ' 237 | ' GameStatusStrip 238 | ' 239 | GameStatusStrip.BackColor = SystemColors.Control 240 | GameStatusStrip.Items.AddRange(New ToolStripItem() {InfoToolStripStatusLabel, ScoreToolStripStatusLabel, TimeToolStripStatusLabel}) 241 | GameStatusStrip.Location = New Point(0, 520) 242 | GameStatusStrip.Name = "GameStatusStrip" 243 | GameStatusStrip.Size = New Size(694, 22) 244 | GameStatusStrip.TabIndex = 19 245 | GameStatusStrip.Text = "StatusStrip1" 246 | ' 247 | ' InfoToolStripStatusLabel 248 | ' 249 | InfoToolStripStatusLabel.Name = "InfoToolStripStatusLabel" 250 | InfoToolStripStatusLabel.Size = New Size(586, 17) 251 | InfoToolStripStatusLabel.Spring = True 252 | ' 253 | ' TimeToolStripStatusLabel 254 | ' 255 | TimeToolStripStatusLabel.Name = "TimeToolStripStatusLabel" 256 | TimeToolStripStatusLabel.Size = New Size(45, 17) 257 | TimeToolStripStatusLabel.Text = "Time: 0" 258 | ' 259 | ' CardBacksImageList 260 | ' 261 | CardBacksImageList.ColorDepth = ColorDepth.Depth32Bit 262 | CardBacksImageList.ImageStream = CType(resources.GetObject("CardBacksImageList.ImageStream"), ImageListStreamer) 263 | CardBacksImageList.TransparentColor = Color.Fuchsia 264 | CardBacksImageList.Images.SetKeyName(0, "") 265 | CardBacksImageList.Images.SetKeyName(1, "") 266 | CardBacksImageList.Images.SetKeyName(2, "") 267 | CardBacksImageList.Images.SetKeyName(3, "") 268 | CardBacksImageList.Images.SetKeyName(4, "") 269 | CardBacksImageList.Images.SetKeyName(5, "") 270 | CardBacksImageList.Images.SetKeyName(6, "") 271 | CardBacksImageList.Images.SetKeyName(7, "") 272 | CardBacksImageList.Images.SetKeyName(8, "") 273 | CardBacksImageList.Images.SetKeyName(9, "") 274 | CardBacksImageList.Images.SetKeyName(10, "") 275 | CardBacksImageList.Images.SetKeyName(11, "") 276 | ' 277 | ' StackPictureBox_6 278 | ' 279 | StackPictureBox_6.Location = New Point(603, 169) 280 | StackPictureBox_6.Name = "StackPictureBox_6" 281 | StackPictureBox_6.Size = New Size(85, 140) 282 | StackPictureBox_6.TabIndex = 13 283 | StackPictureBox_6.TabStop = False 284 | ' 285 | ' StackPictureBox_5 286 | ' 287 | StackPictureBox_5.Location = New Point(504, 169) 288 | StackPictureBox_5.Name = "StackPictureBox_5" 289 | StackPictureBox_5.Size = New Size(85, 136) 290 | StackPictureBox_5.TabIndex = 12 291 | StackPictureBox_5.TabStop = False 292 | ' 293 | ' StackPictureBox_4 294 | ' 295 | StackPictureBox_4.Location = New Point(406, 169) 296 | StackPictureBox_4.Name = "StackPictureBox_4" 297 | StackPictureBox_4.Size = New Size(85, 133) 298 | StackPictureBox_4.TabIndex = 11 299 | StackPictureBox_4.TabStop = False 300 | ' 301 | ' StackPictureBox_2 302 | ' 303 | StackPictureBox_2.Location = New Point(209, 169) 304 | StackPictureBox_2.Name = "StackPictureBox_2" 305 | StackPictureBox_2.Size = New Size(85, 125) 306 | StackPictureBox_2.TabIndex = 9 307 | StackPictureBox_2.TabStop = False 308 | ' 309 | ' StackPictureBox_1 310 | ' 311 | StackPictureBox_1.Location = New Point(111, 169) 312 | StackPictureBox_1.Name = "StackPictureBox_1" 313 | StackPictureBox_1.Size = New Size(85, 122) 314 | StackPictureBox_1.TabIndex = 8 315 | StackPictureBox_1.TabStop = False 316 | ' 317 | ' StackPictureBox_0 318 | ' 319 | StackPictureBox_0.Location = New Point(12, 169) 320 | StackPictureBox_0.Name = "StackPictureBox_0" 321 | StackPictureBox_0.Size = New Size(85, 118) 322 | StackPictureBox_0.TabIndex = 7 323 | StackPictureBox_0.TabStop = False 324 | ' 325 | ' AcePictureBox_1 326 | ' 327 | AcePictureBox_1.BackColor = Color.Transparent 328 | AcePictureBox_1.Location = New Point(406, 43) 329 | AcePictureBox_1.Name = "AcePictureBox_1" 330 | AcePictureBox_1.Size = New Size(86, 118) 331 | AcePictureBox_1.TabIndex = 4 332 | AcePictureBox_1.TabStop = False 333 | ' 334 | ' AcePictureBox_0 335 | ' 336 | AcePictureBox_0.BackColor = Color.Transparent 337 | AcePictureBox_0.Location = New Point(307, 43) 338 | AcePictureBox_0.Name = "AcePictureBox_0" 339 | AcePictureBox_0.Size = New Size(87, 118) 340 | AcePictureBox_0.TabIndex = 3 341 | AcePictureBox_0.TabStop = False 342 | ' 343 | ' DeckToDealPictureBox 344 | ' 345 | DeckToDealPictureBox.BackColor = Color.Green 346 | DeckToDealPictureBox.Location = New Point(12, 43) 347 | DeckToDealPictureBox.Name = "DeckToDealPictureBox" 348 | DeckToDealPictureBox.Size = New Size(96, 122) 349 | DeckToDealPictureBox.TabIndex = 1 350 | DeckToDealPictureBox.TabStop = False 351 | ' 352 | ' SpadesImageList 353 | ' 354 | SpadesImageList.ColorDepth = ColorDepth.Depth32Bit 355 | SpadesImageList.ImageStream = CType(resources.GetObject("SpadesImageList.ImageStream"), ImageListStreamer) 356 | SpadesImageList.TransparentColor = Color.Fuchsia 357 | SpadesImageList.Images.SetKeyName(0, "") 358 | SpadesImageList.Images.SetKeyName(1, "") 359 | SpadesImageList.Images.SetKeyName(2, "") 360 | SpadesImageList.Images.SetKeyName(3, "") 361 | SpadesImageList.Images.SetKeyName(4, "") 362 | SpadesImageList.Images.SetKeyName(5, "") 363 | SpadesImageList.Images.SetKeyName(6, "") 364 | SpadesImageList.Images.SetKeyName(7, "") 365 | SpadesImageList.Images.SetKeyName(8, "") 366 | SpadesImageList.Images.SetKeyName(9, "") 367 | SpadesImageList.Images.SetKeyName(10, "") 368 | SpadesImageList.Images.SetKeyName(11, "") 369 | SpadesImageList.Images.SetKeyName(12, "") 370 | ' 371 | ' ClubsImageList 372 | ' 373 | ClubsImageList.ColorDepth = ColorDepth.Depth16Bit 374 | ClubsImageList.ImageStream = CType(resources.GetObject("ClubsImageList.ImageStream"), ImageListStreamer) 375 | ClubsImageList.TransparentColor = Color.Fuchsia 376 | ClubsImageList.Images.SetKeyName(0, "") 377 | ClubsImageList.Images.SetKeyName(1, "") 378 | ClubsImageList.Images.SetKeyName(2, "") 379 | ClubsImageList.Images.SetKeyName(3, "") 380 | ClubsImageList.Images.SetKeyName(4, "") 381 | ClubsImageList.Images.SetKeyName(5, "") 382 | ClubsImageList.Images.SetKeyName(6, "") 383 | ClubsImageList.Images.SetKeyName(7, "") 384 | ClubsImageList.Images.SetKeyName(8, "") 385 | ClubsImageList.Images.SetKeyName(9, "") 386 | ClubsImageList.Images.SetKeyName(10, "") 387 | ClubsImageList.Images.SetKeyName(11, "") 388 | ClubsImageList.Images.SetKeyName(12, "") 389 | ' 390 | ' StackPictureBox_3 391 | ' 392 | StackPictureBox_3.BackColor = Color.Transparent 393 | StackPictureBox_3.Location = New Point(307, 169) 394 | StackPictureBox_3.Name = "StackPictureBox_3" 395 | StackPictureBox_3.Size = New Size(86, 129) 396 | StackPictureBox_3.TabIndex = 10 397 | StackPictureBox_3.TabStop = False 398 | ' 399 | ' AcePictureBox_3 400 | ' 401 | AcePictureBox_3.BackColor = Color.Transparent 402 | AcePictureBox_3.Location = New Point(603, 43) 403 | AcePictureBox_3.Name = "AcePictureBox_3" 404 | AcePictureBox_3.Size = New Size(86, 118) 405 | AcePictureBox_3.TabIndex = 6 406 | AcePictureBox_3.TabStop = False 407 | ' 408 | ' DropPanelPictureBox 409 | ' 410 | DropPanelPictureBox.AllowDrop = True 411 | DropPanelPictureBox.BackColor = Color.Green 412 | DropPanelPictureBox.Location = New Point(111, 43) 413 | DropPanelPictureBox.Name = "DropPanelPictureBox" 414 | DropPanelPictureBox.Size = New Size(124, 122) 415 | DropPanelPictureBox.TabIndex = 17 416 | DropPanelPictureBox.TabStop = False 417 | ' 418 | ' GameTimer 419 | ' 420 | GameTimer.Enabled = True 421 | GameTimer.Interval = 1000 422 | ' 423 | ' DragBoxPictureBox_1 424 | ' 425 | DragBoxPictureBox_1.BackColor = Color.Gray 426 | DragBoxPictureBox_1.Location = New Point(0, 0) 427 | DragBoxPictureBox_1.Name = "DragBoxPictureBox_1" 428 | DragBoxPictureBox_1.Size = New Size(0, 0) 429 | DragBoxPictureBox_1.TabIndex = 14 430 | DragBoxPictureBox_1.TabStop = False 431 | ' 432 | ' DiamondsImageList 433 | ' 434 | DiamondsImageList.ColorDepth = ColorDepth.Depth8Bit 435 | DiamondsImageList.ImageStream = CType(resources.GetObject("DiamondsImageList.ImageStream"), ImageListStreamer) 436 | DiamondsImageList.TransparentColor = Color.Blue 437 | DiamondsImageList.Images.SetKeyName(0, "") 438 | DiamondsImageList.Images.SetKeyName(1, "") 439 | DiamondsImageList.Images.SetKeyName(2, "") 440 | DiamondsImageList.Images.SetKeyName(3, "") 441 | DiamondsImageList.Images.SetKeyName(4, "") 442 | DiamondsImageList.Images.SetKeyName(5, "") 443 | DiamondsImageList.Images.SetKeyName(6, "") 444 | DiamondsImageList.Images.SetKeyName(7, "") 445 | DiamondsImageList.Images.SetKeyName(8, "") 446 | DiamondsImageList.Images.SetKeyName(9, "") 447 | DiamondsImageList.Images.SetKeyName(10, "") 448 | DiamondsImageList.Images.SetKeyName(11, "") 449 | DiamondsImageList.Images.SetKeyName(12, "") 450 | ' 451 | ' DragBoxPictureBox_4 452 | ' 453 | DragBoxPictureBox_4.BackColor = Color.Gray 454 | DragBoxPictureBox_4.Location = New Point(0, 0) 455 | DragBoxPictureBox_4.Name = "DragBoxPictureBox_4" 456 | DragBoxPictureBox_4.Size = New Size(0, 0) 457 | DragBoxPictureBox_4.TabIndex = 14 458 | DragBoxPictureBox_4.TabStop = False 459 | ' 460 | ' DragBoxPictureBox_3 461 | ' 462 | DragBoxPictureBox_3.BackColor = Color.Gray 463 | DragBoxPictureBox_3.Location = New Point(0, 0) 464 | DragBoxPictureBox_3.Name = "DragBoxPictureBox_3" 465 | DragBoxPictureBox_3.Size = New Size(0, 0) 466 | DragBoxPictureBox_3.TabIndex = 14 467 | DragBoxPictureBox_3.TabStop = False 468 | ' 469 | ' DragBoxPictureBox_2 470 | ' 471 | DragBoxPictureBox_2.BackColor = Color.Gray 472 | DragBoxPictureBox_2.Location = New Point(0, 0) 473 | DragBoxPictureBox_2.Name = "DragBoxPictureBox_2" 474 | DragBoxPictureBox_2.Size = New Size(0, 0) 475 | DragBoxPictureBox_2.TabIndex = 14 476 | DragBoxPictureBox_2.TabStop = False 477 | ' 478 | ' AcePictureBox_2 479 | ' 480 | AcePictureBox_2.BackColor = Color.Transparent 481 | AcePictureBox_2.Location = New Point(504, 43) 482 | AcePictureBox_2.Name = "AcePictureBox_2" 483 | AcePictureBox_2.Size = New Size(87, 118) 484 | AcePictureBox_2.TabIndex = 5 485 | AcePictureBox_2.TabStop = False 486 | ' 487 | ' GameForm 488 | ' 489 | AutoScaleMode = AutoScaleMode.Inherit 490 | BackColor = Color.Green 491 | ClientSize = New Size(694, 542) 492 | Controls.Add(MenuStrip1) 493 | Controls.Add(GameStatusStrip) 494 | Controls.Add(StackPictureBox_6) 495 | Controls.Add(StackPictureBox_5) 496 | Controls.Add(StackPictureBox_4) 497 | Controls.Add(StackPictureBox_2) 498 | Controls.Add(StackPictureBox_1) 499 | Controls.Add(StackPictureBox_0) 500 | Controls.Add(AcePictureBox_1) 501 | Controls.Add(AcePictureBox_0) 502 | Controls.Add(DeckToDealPictureBox) 503 | Controls.Add(StackPictureBox_3) 504 | Controls.Add(AcePictureBox_3) 505 | Controls.Add(DropPanelPictureBox) 506 | Controls.Add(DragBoxPictureBox_1) 507 | Controls.Add(DragBoxPictureBox_4) 508 | Controls.Add(DragBoxPictureBox_3) 509 | Controls.Add(DragBoxPictureBox_2) 510 | Controls.Add(AcePictureBox_2) 511 | Icon = CType(resources.GetObject("$this.Icon"), Icon) 512 | MinimumSize = New Size(710, 581) 513 | Name = "GameForm" 514 | StartPosition = FormStartPosition.Manual 515 | Text = "'Classic' Solitaire" 516 | MenuStrip1.ResumeLayout(False) 517 | MenuStrip1.PerformLayout() 518 | GameStatusStrip.ResumeLayout(False) 519 | GameStatusStrip.PerformLayout() 520 | CType(StackPictureBox_6, ComponentModel.ISupportInitialize).EndInit() 521 | CType(StackPictureBox_5, ComponentModel.ISupportInitialize).EndInit() 522 | CType(StackPictureBox_4, ComponentModel.ISupportInitialize).EndInit() 523 | CType(StackPictureBox_2, ComponentModel.ISupportInitialize).EndInit() 524 | CType(StackPictureBox_1, ComponentModel.ISupportInitialize).EndInit() 525 | CType(StackPictureBox_0, ComponentModel.ISupportInitialize).EndInit() 526 | CType(AcePictureBox_1, ComponentModel.ISupportInitialize).EndInit() 527 | CType(AcePictureBox_0, ComponentModel.ISupportInitialize).EndInit() 528 | CType(DeckToDealPictureBox, ComponentModel.ISupportInitialize).EndInit() 529 | CType(StackPictureBox_3, ComponentModel.ISupportInitialize).EndInit() 530 | CType(AcePictureBox_3, ComponentModel.ISupportInitialize).EndInit() 531 | CType(DropPanelPictureBox, ComponentModel.ISupportInitialize).EndInit() 532 | CType(DragBoxPictureBox_1, ComponentModel.ISupportInitialize).EndInit() 533 | CType(DragBoxPictureBox_4, ComponentModel.ISupportInitialize).EndInit() 534 | CType(DragBoxPictureBox_3, ComponentModel.ISupportInitialize).EndInit() 535 | CType(DragBoxPictureBox_2, ComponentModel.ISupportInitialize).EndInit() 536 | CType(AcePictureBox_2, ComponentModel.ISupportInitialize).EndInit() 537 | ResumeLayout(False) 538 | PerformLayout() 539 | End Sub 540 | 541 | Private WithEvents StackPictureBox_0 As PictureBox 542 | Private WithEvents StackPictureBox_1 As PictureBox 543 | Private WithEvents StackPictureBox_2 As PictureBox 544 | Private WithEvents StackPictureBox_3 As PictureBox 545 | Private WithEvents StackPictureBox_4 As PictureBox 546 | Private WithEvents StackPictureBox_5 As PictureBox 547 | Private WithEvents StackPictureBox_6 As PictureBox 548 | Private WithEvents AcePictureBox_0 As PictureBox 549 | Private WithEvents AcePictureBox_1 As PictureBox 550 | Private WithEvents AcePictureBox_2 As PictureBox 551 | Private WithEvents AcePictureBox_3 As PictureBox 552 | Private WithEvents DeckToDealPictureBox As PictureBox 553 | Private WithEvents DropPanelPictureBox As PictureBox 554 | Private WithEvents DragBoxPictureBox_1 As PictureBox 555 | Private WithEvents DragBoxPictureBox_2 As PictureBox 556 | Private WithEvents DragBoxPictureBox_3 As PictureBox 557 | Private WithEvents DragBoxPictureBox_4 As PictureBox 558 | Private WithEvents ScoreToolStripStatusLabel As ToolStripStatusLabel 559 | Private WithEvents MenuStrip1 As MenuStrip 560 | Private WithEvents FileToolStripMenuItem As ToolStripMenuItem 561 | Private WithEvents DealToolStripMenuItem As ToolStripMenuItem 562 | Private WithEvents UndoToolStripMenuItem As ToolStripMenuItem 563 | Private WithEvents DeckToolStripMenuItem As ToolStripMenuItem 564 | Private WithEvents OptionsToolStripMenuItem As ToolStripMenuItem 565 | Private WithEvents ToolStripSeparator2 As ToolStripSeparator 566 | Private WithEvents ExitToolStripMenuItem As ToolStripMenuItem 567 | Private WithEvents HelpToolStripMenuItem As ToolStripMenuItem 568 | Private WithEvents ContentsToolStripMenuItem As ToolStripMenuItem 569 | Private WithEvents HowToUseToolStripMenuItem As ToolStripMenuItem 570 | Private WithEvents SearchToolStripMenuItem As ToolStripMenuItem 571 | Private WithEvents ToolStripSeparator5 As ToolStripSeparator 572 | Private WithEvents AboutToolStripMenuItem As ToolStripMenuItem 573 | Private WithEvents GameStatusStrip As StatusStrip 574 | Private WithEvents InfoToolStripStatusLabel As ToolStripStatusLabel 575 | Private WithEvents TimeToolStripStatusLabel As ToolStripStatusLabel 576 | Private WithEvents CardSlotsImageList As ImageList 577 | Private WithEvents AceSpadesImageList As ImageList 578 | Private WithEvents CardBacksImageList As ImageList 579 | Private WithEvents HeartsImageList As ImageList 580 | Private WithEvents SpadesImageList As ImageList 581 | Private WithEvents ClubsImageList As ImageList 582 | Private WithEvents DiamondsImageList As ImageList 583 | Private WithEvents GameTimer As Timer 584 | Private WithEvents ToolStripSeparator1 As ToolStripSeparator 585 | Friend WithEvents CheatWinToolStripMenuItem As ToolStripMenuItem 586 | End Class 587 | -------------------------------------------------------------------------------- /Solitaire/GameForm.vb: -------------------------------------------------------------------------------- 1 | Public Class GameForm 2 | 3 | Public Sub New() 4 | MyBase.New() 5 | 6 | 'This call is required by the Windows Form Designer. 7 | InitializeComponent() 8 | 9 | 'Add any initialization after the InitializeComponent() call. 10 | Startup() 11 | 12 | End Sub 13 | 14 | Private m_settings As Settings 15 | 16 | #Region "Member Variables" 17 | 18 | Private m_mouseX As Integer ' Current x position of mouse. 19 | Private m_mouseY As Integer ' Current y position of mouse. 20 | Private ReadOnly m_stacks As Array = Array.CreateInstance(GetType(Int32), 7, 5, 19) ' Stack array, (stack)(suit, card value, x, y, flipped)(index). 21 | Private ReadOnly m_deck As Array = Array.CreateInstance(GetType(Int32), 2, 24) ' Deck array, (suit, card value)(index). 22 | Private ReadOnly m_drop As Array = Array.CreateInstance(GetType(Int32), 4, 24) ' Drop array, (suit, card value, x, y)(index). 23 | Private ReadOnly m_drag As Array = Array.CreateInstance(GetType(Int32), 3, 13) ' Drag array, (suit, card value, y)(index). 24 | Private ReadOnly m_aceStacks As Array = Array.CreateInstance(GetType(Int32), 4, 2, 13) ' Ace drop array, (stack)(suit, card value)(index). 25 | Private ReadOnly m_stackLengths(6) As Integer ' Length of stack (one greater than last used index). 26 | Private m_deckLength As Integer = 0 ' Cards in dealing deck, -1 when flipping over deck. 27 | Private m_dropLength As Integer = 0 ' Cards in dropping deck. 28 | Private m_dragLength As Integer = 0 ' Cards in drag/drop action. 29 | Private ReadOnly m_aceStackLengths(3) As Integer ' Cards in each ace drop. 30 | Private ReadOnly m_random As New Random ' Random number generator to shuffle deck. 31 | Private m_drawing As Boolean = False ' True when in process of drawing m_winParabola card from deck. 32 | Private m_hitCard As Integer ' Card that the mouse was over when dragging, needed for multiple card drag. 33 | Private m_dragStack As Integer ' Stack dragging cards were originally from: m_stacks < 7; DropPanelPictureBox = 7; aces>7. 34 | Private m_dragging As Boolean = False ' True when drag/drop in process. 35 | Private m_cycleDeck As Integer = 1 ' Number of times player has flipped the deck. 36 | Private m_win As Boolean = False ' False until user wins game. 37 | Private m_winStack As Integer = 0 ' Current stack during win effect. 38 | Private m_winCard As Integer = 12 ' Current card during win effect. 39 | Private m_winX As Integer ' X location of card during win effect. 40 | Private m_winY As Integer ' Y location of card during win effect. 41 | Private m_yMultiplier As Single = 0 ' Multiply Y intercept by this ratio during win effect. 42 | Private m_xMovement As Integer = 0 ' XShift on the win effect. 43 | Private m_xVertex As Integer = 0 ' Horizontal vertex value of current win parabola. 44 | Private m_yVertex As Integer = 0 ' Vertical vertex value of current win parabola. 45 | Private m_winParabola As Single = 0 ' Value of win parabola (y = ax ^ 2 + bx + c). 46 | Private m_newWinStack As Boolean = True ' True when new stack when displaying win effect. 47 | Private m_bounce As Boolean = False ' True if in same stack but bouncing, win effect. 48 | Private m_win2 As Boolean = False ' False until drag panel is set up for win effect. 49 | Private ReadOnly m_suit(3) As Integer ' Suits: spades=0, diamonds=1, clubs=2, hearts=3. 50 | Private ReadOnly m_aceLocation As Array = Array.CreateInstance(GetType(Integer), 2, 4) ' X, Y and suit for ace drops. 51 | Private m_undoType As Integer = 0 ' Undo type for switch and to get info from undo array. 52 | Private ReadOnly m_undo As Array = Array.CreateInstance(GetType(Integer), 7, 3) ' Keeps undo information, (type)(data). 53 | Private m_dragStartY As Integer = 0 ' The y to drop the card at, used for refresh problems. 54 | Private m_dragStartX As Integer = 0 ' The x to drop the card at, used for refresh problems. 55 | Private m_score As Integer = 0 ' Score if keeping score. 56 | Private m_time As Integer = 0 ' Time if keeping time. 57 | 58 | #End Region 59 | 60 | #Region "Graphical Layout Constants" 61 | 62 | Private ReadOnly m_xShift As Integer = 2 ' X shift for DropPanelPictureBox and DeckToDealPictureBox when Settings.DrawOne = True. 63 | Private ReadOnly m_yShift As Integer = 1 ' Y shift for DropPanelPictureBox and DeckToDealPictureBox. 64 | Private ReadOnly m_xBigShift As Integer = 15 ' DropPanelPictureBox X shift when Settings.DrawOne = False. 65 | Private ReadOnly m_small As Integer = 3 ' Unflipped card Y shift. 66 | Private ReadOnly m_large As Integer = 15 ' Flipped card Y shift. 67 | Private ReadOnly m_cardHeight As Integer = 96 68 | Private ReadOnly m_cardWidth As Integer = 71 ' Card width, must corespond to bmp or png width. 69 | 70 | #End Region 71 | 72 | Private Sub Startup() 73 | 74 | CheatWinToolStripMenuItem.Visible = False ' for testing 75 | 76 | m_settings = Settings.Load() 77 | 78 | If Common.EnhancedMode Then 79 | If Not m_settings.Location.Equals(Point.Empty) AndAlso Not m_settings.Size.Equals(Size.Empty) Then 80 | Location = m_settings.Location 81 | 'HACK: shorten the size by 20, somehow we are growing in height. 82 | Dim size As New Size(m_settings.Size.Width, m_settings.Size.Height - 20) 83 | Me.Size = size 84 | Else 85 | 'TODO: should probably validate that the coordinates are visible on the screen. 86 | Dim x = (Screen.PrimaryScreen.WorkingArea.Width - Size.Width) \ 2 87 | Dim y = (Screen.PrimaryScreen.WorkingArea.Height - Size.Height) \ 2 88 | Location = New Point(x, y) 89 | End If 90 | Else 91 | StartPosition = FormStartPosition.WindowsDefaultLocation 92 | MinimumSize = New Size(0, 0) 93 | End If 94 | 95 | ' Deal Cards. 96 | Deal() 97 | 98 | ' Redo layout. 99 | WindowSizeChanged(Nothing, Nothing) 100 | 101 | ' Check user settings. 102 | UpdateStatus() 103 | 104 | ' Set drag panel. 105 | DragBoxPictureBox_1.BringToFront() 106 | DragBoxPictureBox_2.BringToFront() 107 | DragBoxPictureBox_3.BringToFront() 108 | DragBoxPictureBox_4.BringToFront() 109 | 110 | End Sub 111 | 112 | Private Sub Me_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing 113 | If Common.EnhancedMode Then 114 | m_settings.Location = Location 115 | m_settings.Size = Size 116 | Else 117 | m_settings.Location = Point.Empty 118 | m_settings.Size = Size.Empty 119 | End If 120 | Settings.Persist(m_settings) 121 | End Sub 122 | 123 | Private Sub GameTimer_Tick(sender As Object, e As EventArgs) Handles GameTimer.Tick 124 | m_time += 1 125 | If m_time Mod 10 = 0 Then 126 | m_score -= 2 127 | End If 128 | UpdateStatus() 129 | End Sub 130 | 131 | #Region "Dealing/Shuffling Methods" 132 | 133 | Public Sub Deal() 134 | 135 | ' Temporary array for picking out cards (pseudoshuffle). 136 | Dim cards = Array.CreateInstance(GetType(Int32), 4, 13) 137 | Dim suitCard As Point 'New Point(0, 0) 138 | m_cycleDeck = 0 139 | 140 | ' Update options. 141 | UpdateStatus() 142 | 143 | ' Initialize cards. 144 | For i = 0 To 3 145 | For j = 0 To 12 146 | cards.SetValue(0, i, j) 147 | Next 148 | Next 149 | 150 | ' Initialize aces. 151 | For i = 0 To 3 152 | m_aceStackLengths(i) = 0 153 | Next 154 | 155 | ' Clear stacks. 156 | For i = 0 To 6 157 | For j = 0 To 4 158 | For k = 0 To 18 159 | m_stacks.SetValue(0, i, j, k) 160 | Next 161 | Next 162 | Next 163 | 164 | ' Clear deck. 165 | For i = 0 To 23 166 | m_deck.SetValue(0, 0, i) 167 | m_deck.SetValue(0, 1, i) 168 | Next 169 | 170 | ' Clear drop. 171 | For i = 0 To 23 172 | m_drop.SetValue(0, 0, i) 173 | m_drop.SetValue(0, 1, i) 174 | Next 175 | m_dropLength = 0 176 | 177 | ' Reset DragBox. 178 | DragBoxPictureBox_1.Size = New Size(1, 1) 179 | DragBoxPictureBox_1.Location = New Point(0, 0) 180 | 181 | For i = 0 To 6 ' Stack. 182 | Dim y = 0 183 | ' Darddepth up to stack #. 184 | For j = 0 To i - 1 185 | suitCard = NextCard(cards) 186 | ' Stack, suit, cardvalue, x, y, flipped, index. 187 | SetCard(i, suitCard.X, suitCard.Y, 0, y, 0, j) 188 | y += m_small 189 | Next 190 | ' Last card is flipped up. 191 | suitCard = NextCard(cards) 192 | ' Stack, suit, cardvalue, x, y, flipped, index=stack. 193 | SetCard(i, suitCard.X, suitCard.Y, 0, y, 1, i) 194 | Next 195 | 196 | ' Set deck. 197 | Dim kk = 0 198 | For i = 0 To 3 199 | For j = 0 To 12 200 | If CInt(cards.GetValue(i, j)) = 0 Then 201 | cards.SetValue(1, i, j) ' Set used flag. 202 | m_deck.SetValue(i, 0, kk) 203 | m_deck.SetValue(j, 1, kk) 204 | kk += 1 205 | End If 206 | Next 207 | Next 208 | m_deckLength = 24 209 | 210 | Shuffle() 211 | 212 | ' Clear or set variables. 213 | For i = 0 To 6 214 | m_stackLengths(i) = i + 1 215 | Next 216 | For i = 0 To 3 217 | m_aceStackLengths(i) = 0 218 | Next 219 | m_cycleDeck = 1 220 | Select Case m_settings.Scoring 221 | Case Scoring.Standard : m_score = 0 222 | Case Scoring.Vegas : m_score = -52 223 | Case Scoring.VegasCumulative : m_score += -52 224 | End Select 225 | 226 | ' Timer. 227 | m_time = 0 228 | GameTimer.Stop() 229 | UpdateStatus() 230 | 231 | ' Enable undo. 232 | UndoToolStripMenuItem.Enabled = False 233 | 234 | Invalidate(True) 235 | 236 | End Sub 237 | 238 | Private Function NextCard(cards As Array) As Point 239 | 240 | ' Get next random unused card in deck. 241 | 242 | Dim suit As CardSuit 243 | Dim cardValue As Integer 244 | 245 | Do 246 | ' Randomly select m_winParabola suit and card value. 247 | suit = CType(m_random.Next(4), CardSuit) 248 | cardValue = m_random.Next(13) 249 | ' Check to see if the card is already used. 250 | If CInt(cards.GetValue(suit, cardValue)) = 0 Then 251 | ' Not used, so we are done. 252 | Exit Do 253 | End If 254 | Loop 255 | 256 | 'While CInt(cards.GetValue(suit, cardValue)) = 1 ' Card already used. 257 | ' suit = CType(m_random.Next(4), CardSuit) 258 | ' cardValue = m_random.Next(13) 259 | 'End While 260 | 261 | cards.SetValue(1, suit, cardValue) ' Set used flag. 262 | 263 | 'Dim suitCard As New Point(suit, cardValue) 264 | 265 | Return New Point(suit, cardValue) 'suitCard 266 | 267 | End Function 268 | 269 | Private Sub SetCard(stack As Integer, suit As Integer, cardValue As Integer, x As Integer, y As Integer, flipped As Integer, index As Integer) 270 | m_stacks.SetValue(suit, stack, 0, index) ' Suit. 271 | m_stacks.SetValue(cardValue, stack, 1, index) ' Card value. 272 | m_stacks.SetValue(x, stack, 2, index) ' X location. 273 | m_stacks.SetValue(y, stack, 3, index) ' Y location. 274 | m_stacks.SetValue(flipped, stack, 4, index) ' Flipped. 275 | End Sub 276 | 277 | Private Sub Shuffle() 278 | 279 | Dim temp = Array.CreateInstance(GetType(Int32), 2, 24) 280 | Dim templength = m_deckLength 281 | Dim j = 0 282 | 283 | ' Copy data to temp. 284 | For i = 0 To m_deckLength - 1 285 | temp.SetValue(CInt(m_deck.GetValue(0, i)), 0, i) 286 | temp.SetValue(CInt(m_deck.GetValue(1, i)), 1, i) 287 | Next 288 | 289 | For i = 0 To 23 290 | 291 | ' Get random index. 292 | Dim index = m_random.Next(templength) 293 | 294 | ' Copy data at that index to deck. 295 | m_deck.SetValue(CInt(temp.GetValue(0, index)), 0, j) 296 | m_deck.SetValue(CInt(temp.GetValue(1, index)), 1, j) 297 | 298 | ' Increment location in deck. 299 | j += 1 300 | 301 | ' Get last set in temp and move to index. 302 | temp.SetValue(CInt(temp.GetValue(0, templength - 1)), 0, index) 303 | temp.SetValue(CInt(temp.GetValue(1, templength - 1)), 1, index) 304 | 305 | ' Shorten temp. 306 | templength -= 1 307 | 308 | Next 309 | 310 | End Sub 311 | 312 | #End Region 313 | 314 | #Region "Paint/Draw Methods (includes drawing new cards)" 315 | 316 | Private Sub WindowSizeChanged(sender As Object, e As EventArgs) Handles MyBase.Resize 317 | 318 | Dim offset As Integer 319 | 320 | If m_win Then 321 | DragBoxPictureBox_1.Width = Width - 8 322 | DragBoxPictureBox_1.Height = Height - 54 323 | End If 324 | 325 | If Width > 593 Then 326 | offset = (Width - 8 - 7 * m_cardWidth) \ 8 327 | DeckToDealPictureBox.Location = New Point(offset, DeckToDealPictureBox.Location.Y) 328 | DropPanelPictureBox.Location = New Point(2 * offset + m_cardWidth, DropPanelPictureBox.Location.Y) 329 | AcePictureBox_0.Location = New Point(4 * offset + 3 * m_cardWidth, AcePictureBox_0.Location.Y) 330 | AcePictureBox_1.Location = New Point(5 * offset + 4 * m_cardWidth, AcePictureBox_1.Location.Y) 331 | AcePictureBox_2.Location = New Point(6 * offset + 5 * m_cardWidth, AcePictureBox_2.Location.Y) 332 | AcePictureBox_3.Location = New Point(7 * offset + 6 * m_cardWidth, AcePictureBox_3.Location.Y) 333 | 334 | StackPictureBox_0.Location = New Point(offset, StackPictureBox_0.Location.Y) 335 | StackPictureBox_1.Location = New Point(2 * offset + m_cardWidth, StackPictureBox_1.Location.Y) 336 | StackPictureBox_2.Location = New Point(3 * offset + 2 * m_cardWidth, StackPictureBox_2.Location.Y) 337 | StackPictureBox_3.Location = New Point(4 * offset + 3 * m_cardWidth, StackPictureBox_3.Location.Y) 338 | StackPictureBox_4.Location = New Point(5 * offset + 4 * m_cardWidth, StackPictureBox_4.Location.Y) 339 | StackPictureBox_5.Location = New Point(6 * offset + 5 * m_cardWidth, StackPictureBox_5.Location.Y) 340 | StackPictureBox_6.Location = New Point(7 * offset + 6 * m_cardWidth, StackPictureBox_6.Location.Y) 341 | Else 342 | offset = (593 - 8 - 7 * m_cardWidth) \ 8 343 | DeckToDealPictureBox.Location = New Point(offset, DeckToDealPictureBox.Location.Y) 344 | DropPanelPictureBox.Location = New Point(2 * offset + m_cardWidth, DropPanelPictureBox.Location.Y) 345 | AcePictureBox_0.Location = New Point(4 * offset + 3 * m_cardWidth, AcePictureBox_0.Location.Y) 346 | AcePictureBox_1.Location = New Point(5 * offset + 4 * m_cardWidth, AcePictureBox_1.Location.Y) 347 | AcePictureBox_2.Location = New Point(6 * offset + 5 * m_cardWidth, AcePictureBox_2.Location.Y) 348 | AcePictureBox_3.Location = New Point(7 * offset + 6 * m_cardWidth, AcePictureBox_3.Location.Y) 349 | 350 | StackPictureBox_0.Location = New Point(offset, StackPictureBox_0.Location.Y) 351 | StackPictureBox_1.Location = New Point(2 * offset + m_cardWidth, StackPictureBox_1.Location.Y) 352 | StackPictureBox_2.Location = New Point(3 * offset + 2 * m_cardWidth, StackPictureBox_2.Location.Y) 353 | StackPictureBox_3.Location = New Point(4 * offset + 3 * m_cardWidth, StackPictureBox_3.Location.Y) 354 | StackPictureBox_4.Location = New Point(5 * offset + 4 * m_cardWidth, StackPictureBox_4.Location.Y) 355 | StackPictureBox_5.Location = New Point(6 * offset + 5 * m_cardWidth, StackPictureBox_5.Location.Y) 356 | StackPictureBox_6.Location = New Point(7 * offset + 6 * m_cardWidth, StackPictureBox_6.Location.Y) 357 | End If 358 | 359 | End Sub 360 | 361 | Private Sub DoPaint(stack As Integer, sender As Object, e As PaintEventArgs) 362 | If sender Is Nothing Then 363 | End If 364 | 365 | 'Dim i = 0 366 | Dim suit As Integer '= 0 367 | Dim cardvalue As Integer '= 0 368 | Dim x = 0 369 | Dim y = 0 370 | Dim flipped = 1 371 | Dim index As Integer '= 0 372 | Dim stackheight As Integer '= 0 373 | 374 | If stack < 7 Then 375 | index = m_stackLengths(stack) 376 | Else ' Aces. 377 | index = m_aceStackLengths(stack - 7) 378 | End If 379 | 380 | If stack < 7 Then 381 | If m_stackLengths(stack) <> 0 Then 382 | stackheight = CInt(m_stacks.GetValue(stack, 3, m_stackLengths(stack) - 1)) + m_cardHeight 383 | Else 384 | stackheight = m_cardHeight 385 | End If 386 | ' Set stack height. 387 | Select Case stack 388 | Case 0 : StackPictureBox_0.Height = stackheight 389 | Case 1 : StackPictureBox_1.Height = stackheight 390 | Case 2 : StackPictureBox_2.Height = stackheight 391 | Case 3 : StackPictureBox_3.Height = stackheight 392 | Case 4 : StackPictureBox_4.Height = stackheight 393 | Case 5 : StackPictureBox_5.Height = stackheight 394 | Case Else 395 | StackPictureBox_6.Height = stackheight 396 | End Select 397 | End If 398 | 399 | SuspendLayout() 400 | 401 | For i = 0 To index - 1 402 | 403 | If stack < 7 Then 404 | suit = CInt(m_stacks.GetValue(stack, 0, i)) 405 | cardvalue = CInt(m_stacks.GetValue(stack, 1, i)) 406 | y = CInt(m_stacks.GetValue(stack, 3, i)) 407 | flipped = CInt(m_stacks.GetValue(stack, 4, i)) 408 | Else ' Aces. 409 | suit = CInt(m_aceStacks.GetValue(stack - 7, 0, i)) 410 | cardvalue = CInt(m_aceStacks.GetValue(stack - 7, 1, i)) 411 | End If 412 | 413 | If flipped = 0 Then 414 | e.Graphics.DrawImage(CardBacksImageList.Images(m_settings.CardBack), x, y) 415 | ElseIf suit = 0 Then ' Spades. 416 | e.Graphics.DrawImage(SpadesImageList.Images(cardvalue), x, y) 417 | ElseIf suit = 1 Then ' Diamonds. 418 | e.Graphics.DrawImage(DiamondsImageList.Images(cardvalue), x, y) 419 | ElseIf suit = 2 Then ' Clubs. 420 | e.Graphics.DrawImage(ClubsImageList.Images(cardvalue), x, y) 421 | Else ' Hearts. 422 | e.Graphics.DrawImage(HeartsImageList.Images(cardvalue), x, y) 423 | End If 424 | 425 | Next 426 | 427 | ResumeLayout(False) 428 | 429 | End Sub 430 | 431 | Private Sub StackPictureBox_0_Paint(sender As Object, e As PaintEventArgs) Handles StackPictureBox_0.Paint 432 | DoPaint(0, sender, e) 433 | End Sub 434 | 435 | Private Sub StackPictureBox_1_Paint(sender As Object, e As PaintEventArgs) Handles StackPictureBox_1.Paint 436 | DoPaint(1, sender, e) 437 | End Sub 438 | 439 | Private Sub StackPictureBox_2_Paint(sender As Object, e As PaintEventArgs) Handles StackPictureBox_2.Paint 440 | DoPaint(2, sender, e) 441 | End Sub 442 | 443 | Private Sub StackPictureBox_3_Paint(sender As Object, e As PaintEventArgs) Handles StackPictureBox_3.Paint 444 | DoPaint(3, sender, e) 445 | End Sub 446 | 447 | Private Sub StackPictureBox_4_Paint(sender As Object, e As PaintEventArgs) Handles StackPictureBox_4.Paint 448 | DoPaint(4, sender, e) 449 | End Sub 450 | 451 | Private Sub StackPictureBox_5_Paint(sender As Object, e As PaintEventArgs) Handles StackPictureBox_5.Paint 452 | DoPaint(5, sender, e) 453 | End Sub 454 | 455 | Private Sub StackPictureBox_6_Paint(sender As Object, e As PaintEventArgs) Handles StackPictureBox_6.Paint 456 | DoPaint(6, sender, e) 457 | End Sub 458 | 459 | Private Sub AcePictureBox_0_Paint(sender As Object, e As PaintEventArgs) Handles AcePictureBox_0.Paint 460 | If m_aceStackLengths(0) = 0 Then 461 | e.Graphics.DrawImage(CardSlotsImageList.Images(2), 0, 0) 462 | Else 463 | DoPaint(7, sender, e) 464 | End If 465 | End Sub 466 | 467 | Private Sub AcePictureBox_1_Paint(sender As Object, e As PaintEventArgs) Handles AcePictureBox_1.Paint 468 | If m_aceStackLengths(1) = 0 Then 469 | e.Graphics.DrawImage(CardSlotsImageList.Images(2), 0, 0) 470 | Else 471 | DoPaint(8, sender, e) 472 | End If 473 | End Sub 474 | 475 | Private Sub AcePictureBox_2_Paint(sender As Object, e As PaintEventArgs) Handles AcePictureBox_2.Paint 476 | If m_aceStackLengths(2) = 0 Then 477 | e.Graphics.DrawImage(CardSlotsImageList.Images(2), 0, 0) 478 | Else 479 | DoPaint(9, sender, e) 480 | End If 481 | End Sub 482 | 483 | Private Sub AcePictureBox_3_Paint(sender As Object, e As PaintEventArgs) Handles AcePictureBox_3.Paint 484 | If m_aceStackLengths(3) = 0 Then 485 | e.Graphics.DrawImage(CardSlotsImageList.Images(2), 0, 0) 486 | Else 487 | DoPaint(10, sender, e) 488 | End If 489 | 490 | End Sub 491 | 492 | Private Sub DeckToDealPictureBox_Paint(sender As Object, e As PaintEventArgs) Handles DeckToDealPictureBox.Paint 493 | SuspendLayout() 494 | If m_deckLength < 0 OrElse (m_deckLength = 0 AndAlso m_dropLength = 0) Then 495 | ' Display empty deck image. 496 | e.Graphics.DrawImage(CardSlotsImageList.Images(0), 0, 0) 497 | Else 498 | ' Display card backs. 499 | e.Graphics.DrawImage(CardBacksImageList.Images(m_settings.CardBack), 0, 0) 500 | If m_deckLength > 10 Then 501 | e.Graphics.DrawImage(CardBacksImageList.Images(m_settings.CardBack), m_xShift, m_yShift) 502 | End If 503 | If m_deckLength > 20 Then 504 | e.Graphics.DrawImage(CardBacksImageList.Images(m_settings.CardBack), m_xShift + m_xShift, m_yShift + m_yShift) 505 | End If 506 | End If 507 | ResumeLayout(False) 508 | End Sub 509 | 510 | Private Sub DragBoxPictureBox_Paint(sender As Object, e As PaintEventArgs) Handles DragBoxPictureBox_1.Paint, DragBoxPictureBox_2.Paint, DragBoxPictureBox_3.Paint, DragBoxPictureBox_4.Paint 511 | If m_win Then 512 | ' Win effect. 513 | Win(sender, e) 514 | Else 515 | ' Draw images in DragBoxPictureBox. 516 | Dim x = 0 517 | SuspendLayout() 518 | For index = 0 To m_dragLength - 1 519 | Dim suit = CInt(m_drag.GetValue(0, index)) 520 | Dim cardValue = CInt(m_drag.GetValue(1, index)) 521 | Dim y = CInt(m_drag.GetValue(2, index)) 522 | If Not m_settings.Outline Then 523 | Select Case suit 524 | Case 0 : e.Graphics.DrawImage(SpadesImageList.Images(cardValue), x, y) ' Spades 525 | Case 1 : e.Graphics.DrawImage(DiamondsImageList.Images(cardValue), x, y) ' Diamonds 526 | Case 2 : e.Graphics.DrawImage(ClubsImageList.Images(cardValue), x, y) ' Clubs 527 | Case Else ' Hearts 528 | e.Graphics.DrawImage(HeartsImageList.Images(cardValue), x, y) 529 | End Select 530 | Else 531 | ' Outline dragging. 532 | End If 533 | Next 534 | ResumeLayout(False) 535 | End If 536 | End Sub 537 | 538 | Private Sub DeckToDealPictureBox_MouseDown(sender As Object, e As MouseEventArgs) Handles DeckToDealPictureBox.MouseDown 539 | If e.Button = MouseButtons.Right Then 540 | MoveAllPossibleCardsUp() 541 | Return 542 | End If 543 | ' Check if actually over card. 544 | If m_deckLength < 11 AndAlso 545 | e.X < m_cardWidth AndAlso 546 | e.Y < m_cardHeight OrElse 547 | (m_deckLength > 10 AndAlso 548 | m_deckLength < 21 AndAlso 549 | e.X > m_xShift AndAlso 550 | e.X < m_xShift + m_cardWidth AndAlso 551 | e.Y > m_yShift AndAlso 552 | e.Y < m_yShift + m_cardHeight) OrElse 553 | (m_deckLength > 20 AndAlso 554 | e.X > 2 * m_xShift AndAlso 555 | e.X < 2 * m_xShift + m_cardWidth AndAlso 556 | e.Y > 2 * m_yShift AndAlso 557 | e.Y < 2 * m_yShift + m_cardHeight) Then 558 | m_drawing = True 559 | DropPanelPictureBox.Invalidate(New Region(New Rectangle(0, 0, DropPanelPictureBox.Width, DropPanelPictureBox.Height)), False) 560 | If m_deckLength = 1 OrElse m_deckLength = 11 OrElse m_deckLength = 21 Then 561 | DeckToDealPictureBox.Invalidate(New Region(New Rectangle(0, 0, DeckToDealPictureBox.Width, DeckToDealPictureBox.Height)), False) 562 | End If 563 | End If 564 | End Sub 565 | 566 | Private Sub DropPanelPictureBox_Paint(sender As Object, e As PaintEventArgs) Handles DropPanelPictureBox.Paint 567 | SuspendLayout() 568 | If m_drawing Then 569 | Dim limit = 1 570 | If m_deckLength > 0 Then 571 | If Not m_settings.DrawOne Then 572 | limit = 3 573 | If m_deckLength < 3 Then 574 | limit = m_deckLength 575 | End If 576 | End If 577 | ' Set undo information. 578 | m_undo.SetValue(limit, 0, 0) 579 | m_undoType = 0 580 | Dim undoCount = 0 581 | If m_dropLength > 0 Then 582 | If CInt(m_drop.GetValue(3, m_dropLength - 1)) <> 0 Then 583 | undoCount += 1 584 | End If 585 | End If 586 | If m_dropLength > 1 Then 587 | If CInt(m_drop.GetValue(3, m_dropLength - 2)) <> 0 Then 588 | undoCount += 1 589 | End If 590 | End If 591 | m_undo.SetValue(undoCount, 0, 1) 592 | 593 | For i = 0 To limit - 1 594 | 595 | ' Get card for card drop. 596 | Dim suit = CInt(m_deck.GetValue(0, m_deckLength - 1)) 597 | Dim cardvalue = CInt(m_deck.GetValue(1, m_deckLength - 1)) 598 | m_deckLength -= 1 599 | 600 | ' Add card to m_drop array. 601 | m_drop.SetValue(suit, 0, m_dropLength) 602 | m_drop.SetValue(cardvalue, 1, m_dropLength) 603 | m_drop.SetValue(i * m_xBigShift, 2, m_dropLength) 604 | m_drop.SetValue(i * m_yShift, 3, m_dropLength) 605 | m_dropLength += 1 606 | 607 | If m_dropLength > 3 AndAlso CInt(m_drop.GetValue(3, m_dropLength - 3)) <> 0 Then 608 | m_drop.SetValue(0, 2, m_dropLength - 3) 609 | m_drop.SetValue(0, 3, m_dropLength - 3) 610 | End If 611 | If m_dropLength > 4 AndAlso CInt(m_drop.GetValue(3, m_dropLength - 4)) <> 0 Then 612 | m_drop.SetValue(0, 2, m_dropLength - 4) 613 | m_drop.SetValue(0, 3, m_dropLength - 4) 614 | End If 615 | Next i 616 | ' Start timer if first move. 617 | If m_time = 0 AndAlso m_settings.TimedGame Then 618 | GameTimer.Start() 619 | End If 620 | End If 621 | If m_deckLength <= 0 Then ' Reset deck. 622 | If m_deckLength = -1 Then 623 | 624 | ' Set undo information. 625 | m_undoType = 6 626 | 627 | m_cycleDeck += 1 628 | m_deckLength = m_dropLength 629 | 630 | ' Move drop to deck. 631 | Dim k = 0 632 | For i = m_dropLength - 1 To 0 Step -1 633 | m_deck.SetValue(m_drop.GetValue(0, i), 0, k) 634 | m_deck.SetValue(m_drop.GetValue(1, i), 1, k) 635 | k += 1 636 | Next 637 | m_dropLength = 0 638 | 639 | ' Scoring. 640 | If m_settings.Scoring = Scoring.Standard AndAlso m_cycleDeck > 3 AndAlso Not m_settings.DrawOne Then 641 | m_score -= 20 642 | ElseIf m_settings.Scoring = Scoring.Standard AndAlso m_cycleDeck > 1 AndAlso m_settings.DrawOne Then 643 | m_score -= 100 644 | End If 645 | If m_settings.Scoring <> Scoring.None Then 646 | UpdateStatus() 647 | End If 648 | DeckToDealPictureBox.Invalidate(False) 649 | Else 650 | m_deckLength -= 1 ' Set to -1 to flip deck. 651 | DeckToDealPictureBox.Invalidate(False) 652 | End If 653 | End If 654 | m_drawing = False 655 | UndoToolStripMenuItem.Enabled = True 656 | End If 657 | ' Refresh cards. 658 | DealtDeck_Paint(sender, e) 659 | 660 | ResumeLayout(False) 661 | 662 | End Sub 663 | 664 | Private Sub DealtDeck_Paint(sender As Object, e As PaintEventArgs) 665 | 666 | ' Refresh cards. 667 | 668 | Dim x = 0 669 | Dim y = 0 670 | 'Dim newSuit, newCardValue As Integer 671 | 672 | 'TODO: Optimize this code so it only draws the last 3 (or less) cards - those that are visible. 673 | ' Right now, it's drawing every card over each other. 674 | 675 | For j = 0 To m_dropLength - 1 676 | 677 | If m_settings.DrawOne Then 678 | If j = 11 Then 679 | ' Draw one thickness. 680 | y += m_yShift 681 | x += m_xShift 682 | End If 683 | If j = 21 Then 684 | ' Draw one extra thickness. 685 | y += m_yShift 686 | x += m_xShift 687 | End If 688 | Else 689 | ' Draw three actual locations. 690 | x = CInt(m_drop.GetValue(2, j)) 691 | y = CInt(m_drop.GetValue(3, j)) 692 | 'FIX: To clear the background if the last card is being displayed. 693 | If j = m_dropLength - 1 AndAlso x = 0 AndAlso y = 0 Then 694 | ' This is the last card on the pile, clear the background. 695 | e.Graphics.Clear(BackColor) 696 | End If 697 | End If 698 | 699 | Dim newSuit = CInt(m_drop.GetValue(0, j)) 700 | Dim newCardValue = CInt(m_drop.GetValue(1, j)) 701 | 702 | Select Case newSuit 703 | Case 0 : e.Graphics.DrawImage(SpadesImageList.Images(newCardValue), x, y) ' Spades 704 | Case 1 : e.Graphics.DrawImage(DiamondsImageList.Images(newCardValue), x, y) ' Diamonds 705 | Case 2 : e.Graphics.DrawImage(ClubsImageList.Images(newCardValue), x, y) ' Clubs 706 | Case Else ' Hearts 707 | e.Graphics.DrawImage(HeartsImageList.Images(newCardValue), x, y) 708 | End Select 709 | 710 | Next 711 | 712 | End Sub 713 | 714 | 'Private Sub GameStatusBar_Layout(ByVal sender As Object, ByVal e As System.Windows.Forms.LayoutEventArgs) Handles GameStatusBar.Layout 715 | ' UpdateStatus() 716 | 'End Sub 717 | 718 | ' Have to owner draw the panel to get it to be red 719 | ' as panels don't have ForeColors (and StatusBars don't have right alignment). 720 | 'Sub GameStatusBar_DrawItem(ByVal sender As Object, ByVal e As StatusBarDrawItemEventArgs) Handles GameStatusBar.DrawItem 721 | 722 | ' Const labelScore As String = "Score: " 723 | ' Const labelTime As String = "Time: " 724 | ' Const charSpace As Integer = 8 725 | 726 | ' Dim extraChar As Integer = 0 727 | ' Dim bar As StatusBar = CType(sender, StatusBar) 728 | ' Dim textColor As Color = bar.ForeColor 729 | ' Dim output As String = "" 730 | 731 | ' ' Score: xxx. 732 | ' Select Case m_settings.Scoring 733 | ' Case Scoring.None 734 | 735 | ' Case Scoring.Standard 736 | ' output &= m_score 737 | 738 | ' Case Scoring.Vegas, Scoring.VegasCumulative 739 | ' If m_score < 0 Then 740 | ' output &= "-$" & Math.Abs(m_score) 741 | ' textColor = Color.Red 742 | ' extraChar = 2 743 | ' Else 744 | ' output &= "$" & m_score 745 | ' extraChar = 1 746 | ' End If 747 | 748 | ' Case Else 749 | ' Debug.Assert(False) 750 | ' End Select 751 | 752 | ' If m_settings.Scoring <> Scoring.None Then 753 | 754 | ' ' Draw the score label. 755 | ' Dim format As New StringFormat 756 | ' format.Alignment = StringAlignment.Far 757 | ' format.LineAlignment = StringAlignment.Center 758 | ' Dim rect As Rectangle = bar.ClientRectangle 759 | ' If m_settings.TimedGame Then 760 | ' If m_score = 0 OrElse m_time = 0 Then 761 | ' rect.Width -= 64 762 | ' Else 763 | ' rect.Width -= 64 + (CInt(Math.Floor(Math.Log10(CDbl(m_score)))) * charSpace) + (CInt(Math.Floor(Math.Log10(CDbl(m_time)))) * charSpace) 764 | ' End If 765 | ' Else 766 | ' If m_score = 0 Then 767 | ' rect.Width -= 20 768 | ' Else 769 | ' rect.Width -= 20 + CInt(Math.Floor(Math.Log10(CDbl(m_score)))) * charSpace 770 | ' End If 771 | ' End If 772 | ' rect.Width -= extraChar * charSpace 773 | ' e.Graphics.DrawString(labelScore, bar.Font, Brushes.Black, RectangleF.op_Implicit(rect), format) 774 | 775 | ' ' Draw the score. 776 | ' Dim brush As Brush = New SolidBrush(textColor) 777 | ' Try 778 | ' format = New StringFormat 779 | ' format.Alignment = StringAlignment.Far 780 | ' format.LineAlignment = StringAlignment.Center 781 | ' rect = bar.ClientRectangle 782 | ' If m_settings.TimedGame Then 783 | ' If m_time = 0 Then 784 | ' rect.Width -= 49 785 | ' Else 786 | ' rect.Width -= 49 + CInt(Math.Floor(Math.Log10(CDbl(m_time)))) * charSpace 787 | ' End If 788 | ' Else 789 | ' rect.Width -= 8 790 | ' End If 791 | ' e.Graphics.DrawString(output, bar.Font, brush, RectangleF.op_Implicit(rect), format) 792 | ' Finally 793 | ' brush.Dispose() 794 | ' End Try 795 | 796 | ' End If 797 | 798 | ' ' Time: xxx. 799 | ' If m_settings.TimedGame Then 800 | ' Dim format As New StringFormat 801 | ' format.Alignment = StringAlignment.Far 802 | ' format.LineAlignment = StringAlignment.Center 803 | ' Dim rect As Rectangle = bar.ClientRectangle 804 | ' rect.Width -= 5 805 | ' e.Graphics.DrawString(labelTime & m_time.ToString, bar.Font, Brushes.Black, RectangleF.op_Implicit(rect), format) 806 | ' End If 807 | 808 | 'End Sub 809 | 810 | Public Sub UpdateStatus() 811 | 812 | Const labelScore = "Score: " 813 | Const labelTime = "Time: " 814 | 815 | If m_settings IsNot Nothing Then 816 | 817 | If Not m_settings.Outline AndAlso Not DragBoxPictureBox_1.BackColor.Equals(Color.Transparent) Then 818 | DragBoxPictureBox_1.BackColor = Color.Transparent 819 | ElseIf m_settings.Outline AndAlso DragBoxPictureBox_1.BackColor.Equals(Color.Transparent) Then 820 | DragBoxPictureBox_1.BackColor = Color.Gray 821 | End If 822 | If m_settings.Scoring = Scoring.Standard AndAlso m_score < 0 Then 823 | m_score = 0 824 | End If 825 | GameStatusStrip.Visible = m_settings.ViewStatusBar 826 | 827 | Dim textColor = GameStatusStrip.ForeColor 828 | Dim output = "" 829 | 830 | ' Score: xxx. 831 | Select Case m_settings.Scoring 832 | Case Scoring.None 833 | 834 | Case Scoring.Standard 835 | output &= m_score 836 | 837 | Case Scoring.Vegas, Scoring.VegasCumulative 838 | If m_score < 0 Then 839 | output &= "-$" & Math.Abs(m_score) 840 | textColor = Color.Red 841 | Else 842 | output &= "$" & m_score 843 | End If 844 | 845 | Case Else 846 | Debug.Assert(False) 847 | End Select 848 | 849 | If m_settings.Scoring <> Scoring.None Then 850 | ScoreToolStripStatusLabel.Text = labelScore & output 851 | ScoreToolStripStatusLabel.ForeColor = textColor 852 | Else 853 | ScoreToolStripStatusLabel.Text = Nothing 854 | End If 855 | 856 | ' Time: xxx. 857 | If m_settings.TimedGame Then 858 | TimeToolStripStatusLabel.Text = $"{labelTime}{m_time}" 859 | Else 860 | TimeToolStripStatusLabel.Text = Nothing 861 | End If 862 | 863 | End If 864 | 865 | End Sub 866 | 867 | Private Sub InvalidateStack(stack As Integer) 868 | Select Case stack 869 | Case 0 : StackPictureBox_0.Invalidate(False) 870 | Case 1 : StackPictureBox_1.Invalidate(False) 871 | Case 2 : StackPictureBox_2.Invalidate(False) 872 | Case 3 : StackPictureBox_3.Invalidate(False) 873 | Case 4 : StackPictureBox_4.Invalidate(False) 874 | Case 5 : StackPictureBox_5.Invalidate(False) 875 | Case 6 : StackPictureBox_6.Invalidate(False) 876 | Case 7 : DropPanelPictureBox.Invalidate(False) ' Dealt cards. 877 | Case 8 : AcePictureBox_0.Invalidate(False) 878 | Case 9 : AcePictureBox_1.Invalidate(False) 879 | Case 10 : AcePictureBox_2.Invalidate(False) 880 | Case 11 : AcePictureBox_3.Invalidate(False) 881 | End Select 882 | 883 | End Sub 884 | 885 | #End Region 886 | 887 | #Region "Drag/Drop Methods" 888 | 889 | REM Private Sub GenericMouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles GameStatusBar.MouseMove, DeckToDealPictureBox.MouseMove, MyBase.MouseMove 890 | Private Sub GenericMouseMove(sender As Object, e As MouseEventArgs) Handles DeckToDealPictureBox.MouseMove, MyBase.MouseMove 891 | 892 | If m_dragging Then 893 | 894 | Dim deltaX As Integer = DragBoxPictureBox_1.Location.X + (e.X - m_mouseX) 895 | Dim deltaY As Integer = DragBoxPictureBox_1.Location.Y + (e.Y - m_mouseY) 896 | 897 | ' Move DragBoxPictureBox to new delta'd mouse position. 898 | DragBoxPictureBox_1.Location = New Point(deltaX, deltaY) 899 | 900 | If m_settings.Outline Then 901 | deltaX = DragBoxPictureBox_2.Location.X + (e.X - m_mouseX) 902 | deltaY = DragBoxPictureBox_2.Location.Y + (e.Y - m_mouseY) 903 | DragBoxPictureBox_2.Location = New Point(deltaX, deltaY) 904 | 905 | deltaX = DragBoxPictureBox_3.Location.X + (e.X - m_mouseX) 906 | deltaY = DragBoxPictureBox_3.Location.Y + (e.Y - m_mouseY) 907 | DragBoxPictureBox_3.Location = New Point(deltaX, deltaY) 908 | 909 | deltaX = DragBoxPictureBox_4.Location.X + (e.X - m_mouseX) 910 | deltaY = DragBoxPictureBox_4.Location.Y + (e.Y - m_mouseY) 911 | DragBoxPictureBox_4.Location = New Point(deltaX, deltaY) 912 | 913 | End If 914 | End If 915 | 916 | m_mouseX = e.X 917 | m_mouseY = e.Y 918 | 919 | End Sub 920 | 921 | Private Sub DoMouseMove(sender As Object, e As MouseEventArgs, stack As Integer) 922 | If sender Is Nothing Then 923 | End If 924 | If m_dragging Then 925 | Dim deltaX As Integer = DragBoxPictureBox_1.Location.X + (e.X - m_mouseX) 926 | Dim deltaY As Integer = DragBoxPictureBox_1.Location.Y + (e.Y - m_mouseY) 927 | 928 | ' Move DragBoxPictureBox to new delta'd mouse position. 929 | DragBoxPictureBox_1.Location = New Point(deltaX, deltaY) 930 | 931 | If m_settings.Outline Then 932 | deltaX = DragBoxPictureBox_2.Location.X + (e.X - m_mouseX) 933 | deltaY = DragBoxPictureBox_2.Location.Y + (e.Y - m_mouseY) 934 | DragBoxPictureBox_2.Location = New Point(deltaX, deltaY) 935 | 936 | deltaX = DragBoxPictureBox_3.Location.X + (e.X - m_mouseX) 937 | deltaY = DragBoxPictureBox_3.Location.Y + (e.Y - m_mouseY) 938 | DragBoxPictureBox_3.Location = New Point(deltaX, deltaY) 939 | 940 | deltaX = DragBoxPictureBox_4.Location.X + (e.X - m_mouseX) 941 | deltaY = DragBoxPictureBox_4.Location.Y + (e.Y - m_mouseY) 942 | DragBoxPictureBox_4.Location = New Point(deltaX, deltaY) 943 | End If 944 | ElseIf e.Button = System.Windows.Forms.MouseButtons.Left Then 945 | ' Start timer if first move. 946 | If m_time = 0 AndAlso m_settings.TimedGame Then 947 | GameTimer.Start() 948 | End If 949 | ' Find which card was hit. 950 | If FindHit(stack) Then 951 | m_dragStack = stack 952 | m_dragging = True 953 | If stack > 6 OrElse CInt(m_stacks.GetValue(stack, 4, m_hitCard)) = 1 Then ' Flipped up or from DropPanelPictureBox or Aces. 954 | Dim x = 0 955 | Dim y = 0 956 | 'Dim i = 0 957 | Dim locationX = 0 958 | Dim locationY = 0 959 | 960 | If stack < 7 Then 961 | x = CInt(m_stacks.GetValue(stack, 2, m_hitCard)) 962 | y = CInt(m_stacks.GetValue(stack, 3, m_hitCard)) 963 | ElseIf stack = 7 Then ' DropPanelPictureBox. 964 | x = CInt(m_drop.GetValue(2, m_hitCard)) 965 | y = CInt(m_drop.GetValue(3, m_hitCard)) 966 | End If 967 | 968 | If stack > 7 Then ' Aces. 969 | x = 0 970 | y = 0 971 | End If 972 | 973 | ' Get position of card for position of DragBoxPictureBox. 974 | If stack = 0 Then 975 | locationX = StackPictureBox_0.Location.X 976 | locationY = StackPictureBox_0.Location.Y 977 | ElseIf stack = 1 Then 978 | locationX = StackPictureBox_1.Location.X 979 | locationY = StackPictureBox_1.Location.Y 980 | ElseIf stack = 2 Then 981 | locationX = StackPictureBox_2.Location.X 982 | locationY = StackPictureBox_2.Location.Y 983 | ElseIf stack = 3 Then 984 | locationX = StackPictureBox_3.Location.X 985 | locationY = StackPictureBox_3.Location.Y 986 | ElseIf stack = 4 Then 987 | locationX = StackPictureBox_4.Location.X 988 | locationY = StackPictureBox_4.Location.Y 989 | ElseIf stack = 5 Then 990 | locationX = StackPictureBox_5.Location.X 991 | locationY = StackPictureBox_5.Location.Y 992 | ElseIf stack = 6 Then 993 | locationX = StackPictureBox_6.Location.X 994 | locationY = StackPictureBox_6.Location.Y 995 | ElseIf stack = 7 Then 996 | locationX = DropPanelPictureBox.Location.X 997 | locationY = DropPanelPictureBox.Location.Y 998 | ElseIf stack = 8 Then 999 | locationX = AcePictureBox_0.Location.X 1000 | locationY = AcePictureBox_0.Location.Y 1001 | ElseIf stack = 9 Then 1002 | locationX = AcePictureBox_1.Location.X 1003 | locationY = AcePictureBox_1.Location.Y 1004 | ElseIf stack = 10 Then 1005 | locationX = AcePictureBox_2.Location.X 1006 | locationY = AcePictureBox_2.Location.Y 1007 | ElseIf stack = 11 Then 1008 | locationX = AcePictureBox_3.Location.X 1009 | locationY = AcePictureBox_3.Location.Y 1010 | End If 1011 | 1012 | ' Calculate height of DragBoxPictureBox. 1013 | Dim dragboxheight As Integer 1014 | If stack > 6 Then ' Aces and drop box. 1015 | dragboxheight = m_cardHeight 1016 | Else 1017 | dragboxheight = m_cardHeight + m_large * (m_stackLengths(stack) - m_hitCard - 1) 1018 | End If 1019 | ' Copy information of dragging cards to drag array. 1020 | Dim i = m_hitCard 1021 | Dim j = 0 1022 | If stack > 7 Then ' Aces. 1023 | m_drag.SetValue(m_aceStacks.GetValue(stack - 8, 0, i), 0, j) ' Copy suit. 1024 | m_drag.SetValue(m_aceStacks.GetValue(stack - 8, 1, i), 1, j) ' Copy card value. 1025 | m_drag.SetValue(0, 2, j) ' Set y = 0. 1026 | m_dragLength = 1 ' Set drag length to 1 card. 1027 | If Not m_settings.Outline Then 1028 | m_aceStackLengths((stack - 8)) -= 1 ' Make ace stack length 1 card smaller. 1029 | End If 1030 | ElseIf stack = 7 Then ' Drop box. 1031 | m_drag.SetValue(m_drop.GetValue(0, i), 0, j) ' Copy suit. 1032 | m_drag.SetValue(m_drop.GetValue(1, i), 1, j) ' Copy card value. 1033 | m_drag.SetValue(0, 2, j) ' Set y = 0. 1034 | m_dragLength = 1 ' Set drag length to 1 card. 1035 | If Not m_settings.Outline Then 1036 | m_dropLength -= 1 ' Make drop 1 card smaller. 1037 | End If 1038 | Else ' Stacks. 1039 | While i < m_stackLengths(stack) 1040 | m_drag.SetValue(m_stacks.GetValue(stack, 0, i), 0, j) ' Copy suit. 1041 | m_drag.SetValue(m_stacks.GetValue(stack, 1, i), 1, j) ' Copy card value. 1042 | m_drag.SetValue(CInt(m_stacks.GetValue(stack, 3, i)) - y, 2, j) ' Copy Y (adjusting for offset). 1043 | i += 1 1044 | j += 1 1045 | End While 1046 | 1047 | ' Calculate length of drag array. 1048 | m_dragLength = m_stackLengths(stack) - m_hitCard 1049 | 1050 | ' Shorten stack. 1051 | If Not m_settings.Outline Then 1052 | m_stackLengths(stack) = m_hitCard ' Note that the dragging cards are still in the stack. 1053 | End If 1054 | End If ' Modify DragBoxPictureBox for move. 1055 | DragBoxPictureBox_1.Location = New Point(locationX + x, locationY + y) 1056 | If Not m_settings.Outline Then 1057 | DragBoxPictureBox_1.Size = New Size(m_cardWidth, dragboxheight) 1058 | Else 1059 | DragBoxPictureBox_1.Size = New Size(1, dragboxheight) 1060 | DragBoxPictureBox_2.Location = New Point(locationX + x, locationY + y) 1061 | DragBoxPictureBox_2.Size = New Size(m_cardWidth, 1) 1062 | DragBoxPictureBox_3.Location = New Point(locationX + x + m_cardWidth, locationY + y) 1063 | DragBoxPictureBox_3.Size = New Size(1, dragboxheight + 1) 1064 | DragBoxPictureBox_4.Location = New Point(locationX + x, locationY + y + dragboxheight) 1065 | DragBoxPictureBox_4.Size = New Size(m_cardWidth, 1) 1066 | End If 1067 | 1068 | ' Refresh bug fix. 1069 | m_dragStartX = locationX + x 1070 | m_dragStartY = locationY + y 1071 | 1072 | Dim deltax As Integer = DragBoxPictureBox_1.Location.X + (e.X - m_mouseX) 1073 | Dim deltay As Integer = DragBoxPictureBox_1.Location.Y + (e.Y - m_mouseY) 1074 | 1075 | ' Move DragBoxPictureBox to new delta'd mouse position. 1076 | DragBoxPictureBox_1.Location = New Point(deltax, deltay) 1077 | 1078 | If m_settings.Outline Then 1079 | deltax = DragBoxPictureBox_2.Location.X + (e.X - m_mouseX) 1080 | deltay = DragBoxPictureBox_2.Location.Y + (e.Y - m_mouseY) 1081 | DragBoxPictureBox_2.Location = New Point(deltax, deltay) 1082 | 1083 | deltax = DragBoxPictureBox_3.Location.X + (e.X - m_mouseX) 1084 | deltay = DragBoxPictureBox_3.Location.Y + (e.Y - m_mouseY) 1085 | DragBoxPictureBox_3.Location = New Point(deltax, deltay) 1086 | 1087 | deltax = DragBoxPictureBox_4.Location.X + (e.X - m_mouseX) 1088 | deltay = DragBoxPictureBox_4.Location.Y + (e.Y - m_mouseY) 1089 | DragBoxPictureBox_4.Location = New Point(deltax, deltay) 1090 | End If 1091 | 1092 | Invalidate(New Rectangle(deltax, deltay, DragBoxPictureBox_1.Width, DragBoxPictureBox_1.Height), True) 1093 | If m_settings.Outline Then 1094 | Invalidate(True) 1095 | End If 1096 | Else ' Card flipped down. 1097 | m_dragging = False 1098 | End If 1099 | End If 1100 | End If 1101 | 1102 | ' Save new mouse position. 1103 | m_mouseX = e.X 1104 | m_mouseY = e.Y 1105 | 1106 | End Sub 1107 | 1108 | Private Function FindHit(stack As Integer) As Boolean 1109 | 1110 | 'Dim i = 0 1111 | Dim x, y As Integer 1112 | Dim found As Boolean = False 1113 | 1114 | If stack > 7 Then ' Aces. 1115 | If m_aceStackLengths((stack - 8)) <> 0 Then 1116 | found = True 1117 | m_hitCard = m_aceStackLengths((stack - 8)) - 1 1118 | End If 1119 | ElseIf stack = 7 Then ' DropBox. 1120 | If m_dropLength <> 0 Then 1121 | If Not m_settings.DrawOne Then 1122 | x = CInt(m_drop.GetValue(2, m_dropLength - 1)) 1123 | y = CInt(m_drop.GetValue(3, m_dropLength - 1)) 1124 | If m_mouseX > x AndAlso m_mouseX < x + m_cardWidth Then 1125 | If m_mouseY > y AndAlso m_mouseY < y + m_cardWidth Then 1126 | m_hitCard = m_dropLength - 1 1127 | found = True 1128 | End If 1129 | End If 1130 | 'i += 1 1131 | Else ' Draw One. 1132 | If m_mouseX < m_cardWidth Then 1133 | m_hitCard = m_dropLength - 1 1134 | found = True 1135 | End If 1136 | End If 1137 | End If 1138 | Else ' Stacks. 1139 | Dim i = 0 1140 | Dim offset As Integer 1141 | While i < m_stackLengths(stack) AndAlso Not found 1142 | y = CInt(m_stacks.GetValue(stack, 3, i)) 1143 | If i = m_stackLengths(stack) - 1 Then ' Flipped down. 1144 | offset = y + m_cardHeight 1145 | Else 1146 | offset = CInt(m_stacks.GetValue(stack, 3, i + 1)) 1147 | End If 1148 | If m_mouseY >= y AndAlso i = m_stackLengths(stack) - 1 AndAlso m_mouseY < offset OrElse (m_mouseY >= y AndAlso m_mouseY < offset) Then 1149 | m_hitCard = i 1150 | found = True 1151 | End If 1152 | i += 1 1153 | End While 1154 | End If 1155 | 1156 | Return found 1157 | 1158 | End Function 1159 | 1160 | Private Function HoverTest(i As Integer, left As Integer, right As Integer, top As Integer, bottom As Integer, thisStack As Integer) As Boolean 1161 | 1162 | Dim found As Boolean = False 1163 | Dim cleft, cright, ctop, cbottom As Integer 1164 | 1165 | cleft = Controls(i).Location.X 1166 | cright = cleft + m_cardWidth 1167 | ctop = Controls(i).Location.Y 1168 | cbottom = ctop + Controls(i).Height 1169 | 1170 | If cleft < left AndAlso cright > left OrElse (cleft > left AndAlso cleft < right) AndAlso thisStack <> Controls(i).TabIndex Then 1171 | ' Horizontal match. 1172 | If ctop < top AndAlso cbottom > top OrElse (ctop > top AndAlso ctop < bottom) Then 1173 | ' Vertical match. 1174 | found = True 1175 | End If 1176 | End If 1177 | 1178 | Return found 1179 | 1180 | End Function 1181 | 1182 | Private Sub StackPictureBox_0_MouseMove(sender As Object, e As MouseEventArgs) Handles StackPictureBox_0.MouseMove 1183 | DoMouseMove(sender, e, 0) 1184 | End Sub 1185 | 1186 | Private Sub StackPictureBox_1_MouseMove(sender As Object, e As MouseEventArgs) Handles StackPictureBox_1.MouseMove 1187 | DoMouseMove(sender, e, 1) 1188 | End Sub 1189 | 1190 | Private Sub StackPictureBox_2_MouseMove(sender As Object, e As MouseEventArgs) Handles StackPictureBox_2.MouseMove 1191 | DoMouseMove(sender, e, 2) 1192 | End Sub 1193 | 1194 | Private Sub StackPictureBox_3_MouseMove(sender As Object, e As MouseEventArgs) Handles StackPictureBox_3.MouseMove 1195 | DoMouseMove(sender, e, 3) 1196 | End Sub 1197 | 1198 | Private Sub StackPictureBox_4_MouseMove(sender As Object, e As MouseEventArgs) Handles StackPictureBox_4.MouseMove 1199 | DoMouseMove(sender, e, 4) 1200 | End Sub 1201 | 1202 | Private Sub StackPictureBox_5_MouseMove(sender As Object, e As MouseEventArgs) Handles StackPictureBox_5.MouseMove 1203 | DoMouseMove(sender, e, 5) 1204 | End Sub 1205 | 1206 | Private Sub StackPictureBox_6_MouseMove(sender As Object, e As MouseEventArgs) Handles StackPictureBox_6.MouseMove 1207 | DoMouseMove(sender, e, 6) 1208 | End Sub 1209 | 1210 | Private Sub DropPanelPictureBox_MouseMove(sender As Object, e As MouseEventArgs) Handles DropPanelPictureBox.MouseMove 1211 | DoMouseMove(sender, e, 7) 1212 | End Sub 1213 | 1214 | Private Sub AcePictureBox_0_MouseMove(sender As Object, e As MouseEventArgs) Handles AcePictureBox_0.MouseMove 1215 | DoMouseMove(sender, e, 8) 1216 | End Sub 1217 | 1218 | Private Sub AcePictureBox_1_MouseMove(sender As Object, e As MouseEventArgs) Handles AcePictureBox_1.MouseMove 1219 | DoMouseMove(sender, e, 9) 1220 | End Sub 1221 | 1222 | Private Sub AcePictureBox_2_MouseMove(sender As Object, e As MouseEventArgs) Handles AcePictureBox_2.MouseMove 1223 | DoMouseMove(sender, e, 10) 1224 | End Sub 1225 | 1226 | Private Sub AcePictureBox_3_MouseMove(sender As Object, e As MouseEventArgs) Handles AcePictureBox_3.MouseMove 1227 | DoMouseMove(sender, e, 11) 1228 | End Sub 1229 | 1230 | Sub MoveAllPossibleCardsUp() 1231 | 1232 | Dim working = True ' Are there more iterations to try? 1233 | Dim cardsMoved = 0 ' Number of cards moved to ace stacks. Used for scoring. 1234 | 'Dim i As Integer = 0 ' Ace iteration variable. 1235 | 'Dim j As Integer = 0 ' Stack iteration variable. 1236 | Dim aceSuit As Integer '= 0 ' Suits: spades=0, diamonds=1, clubs=2, hearts=3, undetermined=4. 1237 | Dim aceCard As Integer = 0 ' Top ace card value. 1238 | Dim currentSuit As Integer '= 0 ' Suits: spades=0, diamonds=1, clubs=2, hearts=3. 1239 | Dim currentCard As Integer '= 0 ' Top stack card value. 1240 | Dim currentFlipped As Integer '= 0 ' Whether card on stack is face up; no=0, yes=1. 1241 | 1242 | ' Find out what can be moved and move it. 1243 | While working 1244 | working = False 1245 | For i = 0 To 3 ' Go through each ace. 1246 | ' Get ace info. 1247 | If CInt(m_aceStackLengths.GetValue(i)) <> 0 Then 1248 | aceSuit = CInt(m_aceStacks.GetValue(i, 0, 0)) 1249 | aceCard = CInt(m_aceStackLengths.GetValue(i)) - 1 1250 | Else 1251 | aceSuit = 4 1252 | End If 1253 | If m_dropLength <> 0 Then ' Check for empty dealt card stack. 1254 | ' Get drop info. 1255 | currentSuit = CInt(m_drop.GetValue(0, m_dropLength - 1)) 1256 | currentCard = CInt(m_drop.GetValue(1, m_dropLength - 1)) 1257 | If currentSuit = aceSuit AndAlso currentCard = aceCard + 1 OrElse (aceSuit = 4 AndAlso currentCard = 0) Then ' Check dealt card. 1258 | ' Move card. 1259 | m_dropLength -= 1 1260 | m_aceStackLengths(i) += 1 1261 | m_aceStacks.SetValue(currentSuit, i, 0, m_aceStackLengths(i) - 1) 1262 | m_aceStacks.SetValue(currentCard, i, 1, m_aceStackLengths(i) - 1) 1263 | ' Set undo info. 1264 | m_undoType = 4 1265 | m_undo.SetValue(i, 4, 0) 1266 | m_undo.SetValue(7, 4, 1) 1267 | UndoToolStripMenuItem.Enabled = True 1268 | ' Invalidate stacks. 1269 | InvalidateStack((i + 8)) 1270 | InvalidateStack(7) 1271 | ' Get new ace info. 1272 | aceSuit = CInt(m_aceStacks.GetValue(i, 0, 0)) 1273 | aceCard = CInt(m_aceStackLengths.GetValue(i)) - 1 1274 | cardsMoved += 1 1275 | working = True 1276 | End If 1277 | End If 1278 | For j = 0 To 6 ' Go through each stack. 1279 | If m_stackLengths(j) <> 0 Then ' Check for empty stack. 1280 | currentSuit = CInt(m_stacks.GetValue(j, 0, m_stackLengths(j) - 1)) 1281 | currentCard = CInt(m_stacks.GetValue(j, 1, m_stackLengths(j) - 1)) 1282 | currentFlipped = CInt(m_stacks.GetValue(j, 4, m_stackLengths(j) - 1)) 1283 | If currentSuit = aceSuit AndAlso currentCard = aceCard + 1 AndAlso currentFlipped = 1 OrElse (aceSuit = 4 AndAlso currentCard = 0 AndAlso currentFlipped = 1) Then ' See if stack is one more than ace in same suit. 1284 | ' Move card. 1285 | m_stackLengths(j) -= 1 1286 | m_aceStackLengths(i) += 1 1287 | m_aceStacks.SetValue(currentSuit, i, 0, m_aceStackLengths(i) - 1) 1288 | m_aceStacks.SetValue(currentCard, i, 1, m_aceStackLengths(i) - 1) 1289 | ' Set undo info. 1290 | m_undoType = 4 1291 | m_undo.SetValue(i, 4, 0) 1292 | m_undo.SetValue(j, 4, 1) 1293 | UndoToolStripMenuItem.Enabled = True 1294 | ' Invalidate stacks. 1295 | InvalidateStack((i + 8)) 1296 | InvalidateStack(j) 1297 | ' Get new ace info. 1298 | aceSuit = CInt(m_aceStacks.GetValue(i, 0, 0)) 1299 | aceCard = CInt(m_aceStackLengths.GetValue(i)) - 1 1300 | cardsMoved += 1 1301 | working = True 1302 | End If 1303 | End If 1304 | Next 1305 | Next 1306 | End While 1307 | 1308 | ' Update scoring. 1309 | If m_settings.Scoring = Scoring.Standard Then 1310 | m_score += 10 * cardsMoved 1311 | UpdateStatus() 1312 | End If 1313 | 1314 | End Sub 1315 | 1316 | Private Sub HandleMouseUp(sender As Object, e As MouseEventArgs) _ 1317 | Handles AcePictureBox_1.MouseUp, 1318 | AcePictureBox_2.MouseUp, 1319 | AcePictureBox_0.MouseUp, 1320 | AcePictureBox_3.MouseUp, 1321 | StackPictureBox_4.MouseUp, 1322 | StackPictureBox_6.MouseUp, 1323 | StackPictureBox_5.MouseUp, 1324 | StackPictureBox_1.MouseUp, 1325 | StackPictureBox_0.MouseUp, 1326 | StackPictureBox_2.MouseUp, 1327 | StackPictureBox_3.MouseUp, 1328 | DropPanelPictureBox.MouseUp, 1329 | DragBoxPictureBox_1.MouseUp, 1330 | DragBoxPictureBox_2.MouseUp, 1331 | DragBoxPictureBox_3.MouseUp, 1332 | DragBoxPictureBox_4.MouseUp, 1333 | MyBase.MouseUp 1334 | 1335 | If Not m_dragging Then 1336 | If e.Button = MouseButtons.Right Then 1337 | MoveAllPossibleCardsUp() 1338 | End If 1339 | Return 1340 | End If 1341 | 1342 | SuspendLayout() 1343 | 1344 | Dim left, right, top, bottom As Integer 1345 | Dim found As Boolean = False 1346 | 'Dim i As Integer = 0 1347 | 1348 | ' Find DragBoxPictureBox_1 location. 1349 | left = DragBoxPictureBox_1.Location.X 1350 | right = left + m_cardWidth 1351 | top = DragBoxPictureBox_1.Location.Y 1352 | bottom = top + DragBoxPictureBox_1.Height 1353 | 1354 | ' Get drag stack so it's not same stack. 1355 | Dim thisstack As Integer = 0 1356 | If m_dragStack < 7 Then ' Stacks. 1357 | thisstack = m_dragStack + 7 1358 | ElseIf m_dragStack > 6 Then ' DropBox. 1359 | thisstack = m_dragStack - 5 1360 | End If 1361 | ' Find which panel the DragBoxPictureBox_1 is over, first go through each panel. 1362 | For i = 0 To (Controls.Count) - 1 1363 | ' If over winParabola panel, drop if card match. 1364 | If HoverTest(i, left, right, top, bottom, thisstack) AndAlso Not found Then 1365 | ' If match, drop cards. 1366 | If Controls(i).TabIndex > 6 AndAlso Controls(i).TabIndex < 14 Then ' Stacks. 1367 | ' Set undo information. 1368 | m_undoType = 1 1369 | m_undo.SetValue(m_dragStack, 1, 0) ' Set drag from. 1370 | m_undo.SetValue(Controls(i).TabIndex, 1, 1) ' Set drag to. 1371 | m_undo.SetValue(m_dragLength, 1, 2) ' Set length. 1372 | UndoToolStripMenuItem.Enabled = True 1373 | ' New stack. 1374 | 'Dim stack As Integer '= 0 1375 | Dim suit As Integer = 0 1376 | Dim flipped As Integer = 0 1377 | Dim cardvalue As Integer = 0 1378 | Dim stack = Controls(i).TabIndex - 7 1379 | If m_stackLengths(stack) <> 0 Then 1380 | suit = CInt(m_stacks.GetValue(stack, 0, m_stackLengths(stack) - 1)) 1381 | cardvalue = CInt(m_stacks.GetValue(stack, 1, m_stackLengths(stack) - 1)) 1382 | flipped = CInt(m_stacks.GetValue(stack, 4, m_stackLengths(stack) - 1)) 1383 | End If 1384 | 1385 | ' Drag stack. 1386 | Dim dSuit As Integer 1387 | Dim dCardValue As Integer 1388 | dSuit = CInt(m_drag.GetValue(0, 0)) 1389 | dCardValue = CInt(m_drag.GetValue(1, 0)) 1390 | 1391 | ' Drop card. 1392 | If dCardValue = 12 AndAlso m_stackLengths(stack) = 0 OrElse (flipped = 1 AndAlso suit Mod 2 <> dSuit Mod 2 AndAlso dCardValue = cardvalue - 1) Then ' Not flipped down, not same color, next card down. 1393 | ' Drop cards on new stack. 1394 | Dim k As Integer = 0 1395 | Dim newY As Integer 1396 | While k < m_dragLength 1397 | dSuit = CInt(m_drag.GetValue(0, k)) 1398 | dCardValue = CInt(m_drag.GetValue(1, k)) 1399 | newY = 0 1400 | If dCardValue <> 12 Then 1401 | newY = CInt(m_stacks.GetValue(stack, 3, m_stackLengths(stack) - 1)) + m_large 1402 | End If 1403 | If k = 0 Then 1404 | m_dragStartY = newY 1405 | End If 1406 | SetCard(stack, dSuit, dCardValue, 0, newY, 1, m_stackLengths(stack)) 1407 | m_stackLengths(stack) += 1 1408 | found = True 1409 | k += 1 1410 | End While 1411 | 1412 | ' Scoring. 1413 | If m_settings.Scoring = Scoring.Standard Then 1414 | If m_dragStack = 7 Then 1415 | m_score += 5 1416 | ElseIf m_dragStack > 7 Then 1417 | m_score -= 15 1418 | End If 1419 | UpdateStatus() 1420 | End If 1421 | 1422 | Controls(i).Invalidate(New Region(New Rectangle(0, m_dragStartY, m_cardWidth, Controls(i).Height)), False) 1423 | End If 1424 | ElseIf Controls(i).TabIndex > 2 AndAlso Controls(i).TabIndex < 7 Then ' Ace drops. 1425 | ' Set undo information. 1426 | m_undoType = 1 1427 | m_undo.SetValue(m_dragStack, 1, 0) ' Set drag from. 1428 | m_undo.SetValue(Controls(i).TabIndex, 1, 1) ' Set drag to. 1429 | m_undo.SetValue(1, 1, 2) 1430 | UndoToolStripMenuItem.Enabled = True 1431 | ' Drag stack. 1432 | Dim dsuit, dcardvalue As Integer 1433 | dsuit = CInt(m_drag.GetValue(0, 0)) 1434 | dcardvalue = CInt(m_drag.GetValue(1, 0)) 1435 | 1436 | ' New stack. 1437 | Dim suit As Integer = 0 1438 | Dim cardvalue As Integer = 0 1439 | 'Dim stack As Integer = 0 1440 | Dim stack = Controls(i).TabIndex - 3 1441 | If m_aceStackLengths(stack) <> 0 Then 1442 | suit = CInt(m_aceStacks.GetValue(stack, 0, m_aceStackLengths(stack) - 1)) 1443 | cardvalue = CInt(m_aceStacks.GetValue(stack, 1, m_aceStackLengths(stack) - 1)) 1444 | End If 1445 | 1446 | If m_aceStackLengths(stack) = 0 AndAlso dcardvalue = 0 OrElse (m_dragLength = 1 AndAlso dsuit = suit AndAlso dcardvalue = cardvalue + 1 AndAlso m_aceStackLengths(stack) <> 0) Then ' Next card or ace on new stack. 1447 | ' Update data. 1448 | m_aceStacks.SetValue(dsuit, stack, 0, m_aceStackLengths(stack)) 1449 | m_aceStacks.SetValue(dcardvalue, stack, 1, m_aceStackLengths(stack)) 1450 | m_aceStackLengths(stack) += 1 1451 | 1452 | ' Scoring. 1453 | If m_settings.Scoring = Scoring.Standard Then 1454 | m_score += 10 1455 | ElseIf m_settings.Scoring = Scoring.Vegas OrElse m_settings.Scoring = Scoring.VegasCumulative Then 1456 | m_score += 5 1457 | End If 1458 | If m_settings.Scoring <> Scoring.None Then 1459 | UpdateStatus() 1460 | End If 1461 | If m_aceStackLengths(0) + m_aceStackLengths(1) + m_aceStackLengths(2) + m_aceStackLengths(3) = 52 Then ' Win. 1462 | m_win = True 1463 | UndoToolStripMenuItem.Enabled = False ' Disable undo. 1464 | DragBoxPictureBox_1.Location = New Point(0, 0) 1465 | DragBoxPictureBox_1.Height = 1 1466 | DragBoxPictureBox_1.Width = 1 1467 | DragBoxPictureBox_1.Invalidate(False) 1468 | End If 1469 | found = True 1470 | 1471 | ' Refresh stack. 1472 | Controls(i).Invalidate(False) 1473 | End If 1474 | End If 1475 | End If 1476 | Next i 1477 | If Not found AndAlso Not m_settings.Outline Then ' Not on dropable control or no card match, return to original. 1478 | If m_dragStack > 7 Then ' Aces. 1479 | m_aceStackLengths((m_dragStack - 8)) += 1 1480 | ElseIf m_dragStack = 7 Then ' Drop panel. 1481 | m_dropLength += 1 1482 | Else 1483 | m_stackLengths(m_dragStack) += m_dragLength 1484 | End If 1485 | ' Refresh stack. 1486 | If m_dragStack < 7 Then 1487 | Invalidate(New Rectangle(m_dragStartX, m_dragStartY, m_cardWidth, m_cardHeight + m_large * m_dragLength), True) 1488 | ElseIf m_dragStack = 7 Then 1489 | Invalidate(New Rectangle(m_dragStartX, m_dragStartY, m_cardWidth, m_cardHeight), True) 1490 | Else 1491 | Invalidate(New Rectangle(m_dragStartX, m_dragStartY, m_cardWidth, m_cardHeight), True) 1492 | End If 1493 | ElseIf found AndAlso m_settings.Outline Then ' Remove from first stack. 1494 | If m_dragStack > 7 Then ' Aces. 1495 | m_aceStackLengths((m_dragStack - 8)) -= 1 1496 | ElseIf m_dragStack = 7 Then ' Drop panel. 1497 | m_dropLength -= 1 1498 | Else 1499 | m_stackLengths(m_dragStack) -= m_dragLength 1500 | End If 1501 | ' Refresh stack. 1502 | If m_dragStack < 7 Then 1503 | InvalidateStack(m_dragStack) 1504 | Else ' Aces or drop panel. 1505 | Invalidate(True) 1506 | End If 1507 | End If 1508 | ' Reset drag box. 1509 | DragBoxPictureBox_1.Size = New Size(0, 0) 1510 | DragBoxPictureBox_2.Size = New Size(0, 0) 1511 | DragBoxPictureBox_3.Size = New Size(0, 0) 1512 | DragBoxPictureBox_4.Size = New Size(0, 0) 1513 | m_dragLength = 0 ' Note data is still in stack. 1514 | m_dragging = False 1515 | 1516 | ResumeLayout(False) 1517 | 1518 | End Sub 1519 | 1520 | #End Region 1521 | 1522 | #Region "Menu Item Methods" 1523 | 1524 | ' Game 1525 | 1526 | Private Sub CheatWinToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CheatWinToolStripMenuItem.Click 1527 | 1528 | m_win = True 1529 | 1530 | For index As Integer = 0 To 12 1531 | m_aceStacks.SetValue(0, 0, 0, index) ' Suit. 1532 | m_aceStacks.SetValue(index, 0, 1, index) ' Card value. 1533 | m_aceStacks.SetValue(1, 1, 0, index) ' Suit. 1534 | m_aceStacks.SetValue(index, 1, 1, index) ' Card value. 1535 | m_aceStacks.SetValue(2, 2, 0, index) ' Suit. 1536 | m_aceStacks.SetValue(index, 2, 1, index) ' Card value. 1537 | m_aceStacks.SetValue(3, 3, 0, index) ' Suit. 1538 | m_aceStacks.SetValue(index, 3, 1, index) ' Card value. 1539 | Next 1540 | 1541 | m_aceStackLengths(0) = 13 1542 | m_aceStackLengths(1) = 13 1543 | m_aceStackLengths(2) = 13 1544 | m_aceStackLengths(3) = 13 1545 | 1546 | m_stackLengths(0) = 0 1547 | m_stackLengths(1) = 0 1548 | m_stackLengths(2) = 0 1549 | m_stackLengths(3) = 0 1550 | m_stackLengths(4) = 0 1551 | m_stackLengths(5) = 0 1552 | m_stackLengths(6) = 0 1553 | 1554 | m_dropLength = 0 1555 | m_deckLength = 0 1556 | 1557 | DragBoxPictureBox_1.Location = New System.Drawing.Point(200, 200) 1558 | DragBoxPictureBox_1.Height = 35 1559 | DragBoxPictureBox_1.Width = 35 1560 | 1561 | DragBoxPictureBox_1.Invalidate(False) 1562 | 1563 | End Sub 1564 | 1565 | Private Sub DealToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DealToolStripMenuItem.Click 1566 | ' Deal m_winParabola new game. 1567 | Deal() 1568 | End Sub 1569 | 1570 | Private Sub UndoToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles UndoToolStripMenuItem.Click 1571 | 1572 | ' Undo 1 move. 1573 | 1574 | Select Case m_undoType 1575 | Case 0 ' Deal m_winParabola card (or three if not deal one). 1576 | 1577 | m_drawing = False 1578 | 1579 | ' Put card(s) back. 1580 | If m_settings.DrawOne Then 1581 | If m_deckLength = -1 Then 1582 | m_deckLength = 0 1583 | End If 1584 | m_deckLength += 1 1585 | m_dropLength -= 1 1586 | Else 1587 | m_deckLength += CInt(m_undo.GetValue(0, 0)) 1588 | m_dropLength -= CInt(m_undo.GetValue(0, 0)) 1589 | If CInt(m_undo.GetValue(0, 1)) = 1 Then 1590 | m_drop.SetValue(m_xBigShift, 2, m_dropLength - 1) 1591 | m_drop.SetValue(m_yShift, 3, m_dropLength - 1) 1592 | End If 1593 | If CInt(m_undo.GetValue(0, 1)) = 2 Then 1594 | m_drop.SetValue(m_xBigShift, 2, m_dropLength - 2) 1595 | m_drop.SetValue(m_yShift, 3, m_dropLength - 2) 1596 | m_drop.SetValue(2 * m_xBigShift, 2, m_dropLength - 1) 1597 | m_drop.SetValue(2 * m_yShift, 3, m_dropLength - 1) 1598 | End If 1599 | End If 1600 | 1601 | ' Refresh stacks. 1602 | If m_deckLength = 1 OrElse m_deckLength = 11 OrElse m_deckLength = 21 Then 1603 | DeckToDealPictureBox.Invalidate(False) 1604 | End If 1605 | InvalidateStack(7) ' DropPanelPictureBox. 1606 | 1607 | Case 1 ' Drag drop. 1608 | Dim dragfrom, dragto, dragquantity As Integer 1609 | dragfrom = CInt(m_undo.GetValue(1, 0)) 1610 | dragto = CInt(m_undo.GetValue(1, 1)) 1611 | dragquantity = CInt(m_undo.GetValue(1, 2)) 1612 | ' Add cards to old stack. 1613 | If dragfrom < 7 Then ' Stacks. 1614 | ' Add back to stack. 1615 | m_stackLengths(dragfrom) += dragquantity 1616 | ' Scoring. 1617 | If dragto < 7 AndAlso m_settings.Scoring = Scoring.Standard Then 1618 | m_score -= 10 1619 | ElseIf dragto < 7 AndAlso (m_settings.Scoring = Scoring.Vegas OrElse m_settings.Scoring = Scoring.VegasCumulative) Then 1620 | m_score -= 5 1621 | End If 1622 | ElseIf dragfrom = 7 Then ' DropPanelPictureBox. 1623 | m_dropLength += 1 1624 | ' Scoring. 1625 | If dragto < 7 AndAlso m_settings.Scoring = Scoring.Standard Then 1626 | m_score -= 10 1627 | ElseIf dragto < 7 AndAlso (m_settings.Scoring = Scoring.Vegas OrElse m_settings.Scoring = Scoring.VegasCumulative) Then 1628 | m_score -= 5 1629 | ElseIf dragto > 6 AndAlso m_settings.Scoring = Scoring.Standard Then 1630 | m_score -= 5 1631 | End If 1632 | Else ' Ace stacks. 1633 | m_aceStackLengths((dragfrom - 8)) += 1 1634 | ' Scoring. 1635 | If dragto > 6 AndAlso m_settings.Scoring = Scoring.Standard Then 1636 | m_score += 15 1637 | ElseIf dragto > 6 AndAlso (m_settings.Scoring = Scoring.Vegas OrElse m_settings.Scoring = Scoring.VegasCumulative) Then 1638 | m_score += 5 1639 | End If 1640 | End If 1641 | If m_settings.Scoring <> Scoring.None Then 1642 | UpdateStatus() 1643 | End If 1644 | ' Remove cards from new stack. 1645 | If dragto > 2 AndAlso dragto < 7 Then ' Aces. 1646 | m_aceStackLengths((dragto - 3)) -= 1 1647 | ElseIf dragto > 6 AndAlso dragto < 14 Then ' Stacks. 1648 | m_stackLengths((dragto - 7)) -= dragquantity 1649 | End If 1650 | ' Refresh drag from. 1651 | InvalidateStack(dragfrom) 1652 | 1653 | ' Refresh drag to. 1654 | If dragto < 7 Then ' Aces. 1655 | InvalidateStack((dragto + 5)) 1656 | ElseIf dragto > 6 Then ' Stacks. 1657 | InvalidateStack((dragto - 7)) 1658 | End If 1659 | 1660 | Case 2 ' Extra... 1661 | 1662 | Case 3 ' Extra... 1663 | 1664 | Case 4 ' Drop 1 card on aces from stack or DropPanelPictureBox from double click. 1665 | 1666 | ' Take off aces. 1667 | m_aceStackLengths(CInt(m_undo.GetValue(4, 0))) -= 1 1668 | 1669 | ' Scoring. 1670 | If m_settings.Scoring = Scoring.Standard Then 1671 | m_score -= 10 1672 | ElseIf m_settings.Scoring = Scoring.Vegas OrElse m_settings.Scoring = Scoring.VegasCumulative Then 1673 | m_score -= 5 1674 | End If 1675 | If m_settings.Scoring <> Scoring.None Then 1676 | UpdateStatus() 1677 | End If 1678 | ' Replace card. 1679 | If CInt(m_undo.GetValue(4, 1)) = 7 Then 1680 | m_dropLength += 1 1681 | Else 1682 | m_stackLengths(CInt(m_undo.GetValue(4, 1))) += 1 1683 | End If 1684 | ' Refresh ace drop. 1685 | If CInt(m_undo.GetValue(4, 0)) < 4 Then 1686 | InvalidateStack((CInt(m_undo.GetValue(4, 0)) + 8)) 1687 | End If 1688 | ' Refresh stack. 1689 | If CInt(m_undo.GetValue(4, 1)) < 7 Then 1690 | InvalidateStack(CInt(m_undo.GetValue(4, 1))) 1691 | End If 1692 | ' Refresh DropPanelPictureBox. 1693 | InvalidateStack(7) 1694 | 1695 | Case 5 ' Flip m_winParabola card. 1696 | 1697 | ' Set flip bit. 1698 | m_stacks.SetValue(0, CInt(m_undo.GetValue(5, 0)), 4, m_stackLengths(CInt(m_undo.GetValue(5, 0))) - 1) 1699 | 1700 | ' Scoring. 1701 | If m_settings.Scoring = Scoring.Standard Then 1702 | m_score -= 5 1703 | UpdateStatus() 1704 | End If 1705 | 1706 | ' Refresh stack. 1707 | If CInt(m_undo.GetValue(5, 0)) < 7 Then 1708 | InvalidateStack(CInt(m_undo.GetValue(5, 0))) 1709 | End If 1710 | 1711 | Case 6 ' Flip over deck for drawing. 1712 | m_cycleDeck -= 1 1713 | m_dropLength = m_deckLength ' Reset m_dropLength to # of cards in deck. 1714 | m_deckLength = -1 ' To show empty image. 1715 | m_drawing = False 1716 | 1717 | ' Scoring. 1718 | If m_settings.Scoring = Scoring.Standard AndAlso m_cycleDeck > 2 AndAlso Not m_settings.DrawOne Then 1719 | m_score += 20 1720 | ElseIf m_settings.Scoring = Scoring.Standard AndAlso m_cycleDeck > 0 AndAlso m_settings.DrawOne Then 1721 | m_score += 100 1722 | End If 1723 | If m_settings.Scoring <> Scoring.None Then 1724 | UpdateStatus() 1725 | End If 1726 | ' Refresh. 1727 | DropPanelPictureBox.Invalidate(New System.Drawing.Region(New System.Drawing.Rectangle(0, 0, DropPanelPictureBox.Width, DropPanelPictureBox.Height))) 1728 | DeckToDealPictureBox.Invalidate(False) 1729 | 1730 | Case Else 1731 | 1732 | End Select 1733 | 1734 | UndoToolStripMenuItem.Enabled = False 1735 | 1736 | End Sub 1737 | 1738 | Private Sub DeckToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DeckToolStripMenuItem.Click 1739 | 1740 | ' Open deck dialog. 1741 | 1742 | Dim dialog As New CardBackDialog With {.Cardback = m_settings.CardBack} 1743 | If dialog.ShowDialog(Me) = DialogResult.OK Then 1744 | m_settings.CardBack = dialog.Cardback 1745 | Deal() 1746 | End If 1747 | 1748 | End Sub 1749 | 1750 | Private Sub OptionsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OptionsToolStripMenuItem.Click 1751 | 1752 | ' Open options dialog box. 1753 | 1754 | Dim dialog = New OptionsDialog With {.Draw = If(m_settings.DrawOne, Draw.One, Draw.Three), 1755 | .Scoring = m_settings.Scoring, 1756 | .TimedGame = m_settings.TimedGame, 1757 | .StatusBar = m_settings.ViewStatusBar, 1758 | .OutlineDragging = m_settings.Outline} 1759 | 1760 | If dialog.ShowDialog(Me) = DialogResult.OK Then 1761 | 1762 | ' Update options. 1763 | m_settings.DrawOne = dialog.Draw = Draw.One 1764 | m_settings.Scoring = dialog.Scoring 1765 | m_settings.TimedGame = dialog.TimedGame 1766 | m_settings.Outline = dialog.OutlineDragging 1767 | m_settings.ViewStatusBar = dialog.StatusBar 1768 | 1769 | ' Check if we need to redeal. 1770 | If dialog.Redeal Then 1771 | If dialog.Scoring <> m_settings.Scoring Then m_score = 0 1772 | Deal() 1773 | Else 1774 | UpdateStatus() 1775 | End If 1776 | 1777 | End If 1778 | 1779 | End Sub 1780 | 1781 | 'Private Sub menuItem1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles menuItem1.Click 1782 | ' MoveAllPossibleCardsUp() 1783 | 'End Sub 1784 | 1785 | Private Sub ExitToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ExitToolStripMenuItem.Click 1786 | ' Exit game. 1787 | Close() 1788 | End Sub 1789 | 1790 | ' Help 1791 | 1792 | Private Sub ContentsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ContentsToolStripMenuItem.Click 1793 | 'Refresh() ' To handle a slight refresh bug. 1794 | Cursor = Cursors.WaitCursor 1795 | Help.ShowHelp(Me, "sol.chm") 1796 | Cursor = Cursors.Default 1797 | End Sub 1798 | 1799 | Private Sub HowToUseoolStripMenuItem_Click(sender As Object, e As EventArgs) Handles HowToUseToolStripMenuItem.Click 1800 | 'Refresh() ' To handle a slight refresh bug. 1801 | Cursor = Cursors.WaitCursor 1802 | Help.ShowHelp(Me, "nthelp.chm") 1803 | Cursor = Cursors.Default 1804 | End Sub 1805 | 1806 | Private Sub SearchToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SearchToolStripMenuItem.Click 1807 | 'Refresh() ' To handle a slight refresh bug. 1808 | Cursor = Cursors.WaitCursor 1809 | Help.ShowHelp(Me, "sol.chm", HelpNavigator.Index) 1810 | Cursor = Cursors.Default 1811 | End Sub 1812 | 1813 | Private Sub AboutToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AboutToolStripMenuItem.Click 1814 | Dim rslt = Win32.ShellAbout(Handle, "'Classic' Solitaire", "Developed by Cory Smith; portions by Christine Morin and Chris Sells.", Icon.Handle) 1815 | End Sub 1816 | 1817 | #End Region 1818 | 1819 | #Region "Single Click Methods - Flip Cards" 1820 | 1821 | Private Sub DoClick(sender As Object, e As EventArgs, stack As Integer) 1822 | If sender Is Nothing OrElse e Is Nothing Then 1823 | End If 1824 | If m_stackLengths(stack) <> 0 AndAlso CInt(m_stacks.GetValue(stack, 4, m_stackLengths(stack) - 1)) = 0 Then 1825 | 1826 | m_stacks.SetValue(1, stack, 4, m_stackLengths(stack) - 1) 1827 | 1828 | ' Scoring. 1829 | If m_settings.Scoring = Scoring.Standard Then 1830 | m_score += 5 1831 | UpdateStatus() 1832 | End If 1833 | 1834 | ' Set undo info - NOT IMPLEMENTED IN REAL SOLITAIRE. 1835 | 'm_undo.SetValue(stack, 5, 0) 1836 | 'm_undoType = 5 1837 | 'UndoToolStripMenuItem.Enabled = True 1838 | UndoToolStripMenuItem.Enabled = False 1839 | 1840 | ' Refresh stack. 1841 | InvalidateStack(stack) 1842 | End If 1843 | 1844 | End Sub 1845 | 1846 | Private Sub StackPictureBox_0_Click(sender As Object, e As EventArgs) Handles StackPictureBox_0.Click 1847 | DoClick(sender, e, 0) 1848 | End Sub 1849 | 1850 | Private Sub StackPictureBox_1_Click(sender As Object, e As EventArgs) Handles StackPictureBox_1.Click 1851 | DoClick(sender, e, 1) 1852 | End Sub 1853 | 1854 | Private Sub StackPictureBox_2_Click(sender As Object, e As EventArgs) Handles StackPictureBox_2.Click 1855 | DoClick(sender, e, 2) 1856 | End Sub 1857 | 1858 | Private Sub StackPictureBox_3_Click(sender As Object, e As EventArgs) Handles StackPictureBox_3.Click 1859 | DoClick(sender, e, 3) 1860 | End Sub 1861 | 1862 | Private Sub StackPictureBox_4_Click(sender As Object, e As EventArgs) Handles StackPictureBox_4.Click 1863 | DoClick(sender, e, 4) 1864 | End Sub 1865 | 1866 | Private Sub StackPictureBox_5_Click(sender As Object, e As EventArgs) Handles StackPictureBox_5.Click 1867 | DoClick(sender, e, 5) 1868 | End Sub 1869 | 1870 | Private Sub StackPictureBox_6_Click(sender As Object, e As EventArgs) Handles StackPictureBox_6.Click 1871 | DoClick(sender, e, 6) 1872 | End Sub 1873 | 1874 | #End Region 1875 | 1876 | #Region "DoubleClick Methods - Send to ace drops." 1877 | 1878 | Private Sub DoDoubleClick(sender As Object, e As EventArgs, stack As Integer) 1879 | If sender Is Nothing OrElse e Is Nothing Then 1880 | End If 1881 | Dim x, y, xRight, yBottom, suit, cardValue, i As Integer 1882 | If stack = 7 AndAlso m_dropLength <> 0 OrElse (stack <> 7 AndAlso m_stackLengths(stack) <> 0) Then ' Stack not empty. 1883 | If stack = 7 Then ' Drop box. 1884 | suit = CInt(m_drop.GetValue(0, m_dropLength - 1)) 1885 | cardValue = CInt(m_drop.GetValue(1, m_dropLength - 1)) 1886 | x = CInt(m_drop.GetValue(2, m_dropLength - 1)) 1887 | y = CInt(m_drop.GetValue(3, m_dropLength - 1)) 1888 | Else ' Stacks. 1889 | suit = CInt(m_stacks.GetValue(stack, 0, m_stackLengths(stack) - 1)) 1890 | cardValue = CInt(m_stacks.GetValue(stack, 1, m_stackLengths(stack) - 1)) 1891 | x = CInt(m_stacks.GetValue(stack, 2, m_stackLengths(stack) - 1)) 1892 | y = CInt(m_stacks.GetValue(stack, 3, m_stackLengths(stack) - 1)) 1893 | End If 1894 | 1895 | xRight = x + m_cardWidth 1896 | yBottom = y + m_cardHeight 1897 | 1898 | ' Check if mouse is over last card. 1899 | If m_mouseX > x AndAlso m_mouseX < xRight AndAlso m_mouseY > y AndAlso m_mouseY < yBottom Then 1900 | If cardValue = 0 Then ' Ace. 1901 | i = 0 1902 | While i < 4 1903 | If m_aceStackLengths(i) = 0 Then 1904 | m_aceStacks.SetValue(suit, i, 0, 0) ' Set suit. 1905 | m_aceStacks.SetValue(cardValue, i, 1, 0) ' Set card value. 1906 | m_aceStackLengths(i) += 1 ' Increment ace stack length. 1907 | If stack = 7 Then ' Drop box. 1908 | m_dropLength -= 1 1909 | Else ' Stacks 1910 | m_stackLengths(stack) -= 1 1911 | End If 1912 | ' Scoring. 1913 | If m_settings.Scoring = Scoring.Standard Then 1914 | m_score += 10 1915 | ElseIf m_settings.Scoring = Scoring.Vegas OrElse m_settings.Scoring = Scoring.VegasCumulative Then 1916 | m_score += 5 1917 | End If 1918 | If m_settings.Scoring <> Scoring.None Then 1919 | UpdateStatus() 1920 | End If 1921 | ' Refresh stack. 1922 | InvalidateStack(stack) 1923 | 1924 | ' Refresh aces. 1925 | InvalidateStack((i + 8)) 1926 | 1927 | ' Set undo info. 1928 | m_undoType = 4 1929 | m_undo.SetValue(i, 4, 0) 1930 | m_undo.SetValue(stack, 4, 1) 1931 | UndoToolStripMenuItem.Enabled = True 1932 | 1933 | i = 3 ' Exit loop. 1934 | End If 1935 | i += 1 1936 | End While 1937 | Else ' Non-Ace. 1938 | i = 0 1939 | While i < 4 1940 | If m_aceStackLengths(i) <> 0 AndAlso CType(m_aceStacks.GetValue(i, 0, m_aceStackLengths(i) - 1), System.Int32) = suit AndAlso CType(m_aceStacks.GetValue(i, 1, m_aceStackLengths(i) - 1), System.Int32) = cardValue - 1 Then 1941 | m_aceStacks.SetValue(suit, i, 0, m_aceStackLengths(i)) ' Set suit. 1942 | m_aceStacks.SetValue(cardValue, i, 1, m_aceStackLengths(i)) ' Set card value. 1943 | m_aceStackLengths(i) += 1 ' Increment ace stack length. 1944 | If stack = 7 Then ' Drop box. 1945 | m_dropLength -= 1 1946 | Else ' Stacks. 1947 | m_stackLengths(stack) -= 1 1948 | End If 1949 | ' Refresh stack. 1950 | InvalidateStack(stack) 1951 | 1952 | ' Refresh aces. 1953 | InvalidateStack((i + 8)) 1954 | 1955 | ' Scoring. 1956 | If m_settings.Scoring = Scoring.Standard Then 1957 | m_score += 10 1958 | ElseIf m_settings.Scoring = Scoring.Vegas OrElse m_settings.Scoring = Scoring.VegasCumulative Then 1959 | m_score += 5 1960 | End If 1961 | If m_settings.Scoring <> Scoring.None Then 1962 | UpdateStatus() 1963 | End If 1964 | ' Set undo info. 1965 | m_undoType = 4 1966 | m_undo.SetValue(i, 4, 0) 1967 | m_undo.SetValue(stack, 4, 1) 1968 | UndoToolStripMenuItem.Enabled = True 1969 | 1970 | If m_aceStackLengths(0) + m_aceStackLengths(1) + m_aceStackLengths(2) + m_aceStackLengths(3) = 52 Then ' Win. 1971 | m_win = True 1972 | UndoToolStripMenuItem.Enabled = False ' Disable undo. 1973 | DragBoxPictureBox_1.Location = New Point(0, 0) 1974 | DragBoxPictureBox_1.Height = 1 1975 | DragBoxPictureBox_1.Width = 1 1976 | DragBoxPictureBox_1.Invalidate(False) 1977 | End If 1978 | 1979 | i = 3 1980 | End If 1981 | i += 1 1982 | End While 1983 | End If 1984 | End If 1985 | Else ' Stack is empty. 1986 | ' Do nothing. 1987 | End If 1988 | 1989 | End Sub 1990 | 1991 | Private Sub StackPictureBox_0_DoubleClick(sender As Object, e As EventArgs) Handles StackPictureBox_0.DoubleClick 1992 | DoDoubleClick(sender, e, 0) 1993 | End Sub 1994 | 1995 | Private Sub StackPictureBox_1_DoubleClick(sender As Object, e As EventArgs) Handles StackPictureBox_1.DoubleClick 1996 | DoDoubleClick(sender, e, 1) 1997 | End Sub 1998 | 1999 | Private Sub StackPictureBox_2_DoubleClick(sender As Object, e As EventArgs) Handles StackPictureBox_2.DoubleClick 2000 | DoDoubleClick(sender, e, 2) 2001 | End Sub 2002 | 2003 | Private Sub StackPictureBox_3_DoubleClick(sender As Object, e As EventArgs) Handles StackPictureBox_3.DoubleClick 2004 | DoDoubleClick(sender, e, 3) 2005 | End Sub 2006 | 2007 | Private Sub StackPictureBox_4_DoubleClick(sender As Object, e As EventArgs) Handles StackPictureBox_4.DoubleClick 2008 | DoDoubleClick(sender, e, 4) 2009 | End Sub 2010 | 2011 | Private Sub StackPictureBox_5_DoubleClick(sender As Object, e As EventArgs) Handles StackPictureBox_5.DoubleClick 2012 | DoDoubleClick(sender, e, 5) 2013 | End Sub 2014 | 2015 | Private Sub StackPictureBox_6_DoubleClick(sender As Object, e As EventArgs) Handles StackPictureBox_6.DoubleClick 2016 | DoDoubleClick(sender, e, 6) 2017 | End Sub 2018 | 2019 | Private Sub DropPanelPictureBox_DoubleClick(sender As Object, e As EventArgs) Handles DropPanelPictureBox.DoubleClick 2020 | DoDoubleClick(sender, e, 7) 2021 | End Sub 2022 | 2023 | #End Region 2024 | 2025 | #Region "Win Effect" 2026 | 2027 | Private Sub Win(sender As Object, e As PaintEventArgs) 2028 | 2029 | If Not m_win2 Then 2030 | 2031 | ' Set up drawing surface. Using drag box. 2032 | DragBoxPictureBox_1.Location = New Point(0, MenuStrip1.Top + MenuStrip1.Height) 2033 | DragBoxPictureBox_1.Width = ClientSize.Width 2034 | DragBoxPictureBox_1.Height = ClientSize.Height - (MenuStrip1.Height + GameStatusStrip.Height) ' 54 2035 | 2036 | ' Get ace stack locations 2037 | m_aceLocation.SetValue(AcePictureBox_0.Location.X, 0, 0) 2038 | m_aceLocation.SetValue(AcePictureBox_0.Location.Y, 1, 0) 2039 | m_aceLocation.SetValue(AcePictureBox_1.Location.X, 0, 1) 2040 | m_aceLocation.SetValue(AcePictureBox_1.Location.Y, 1, 1) 2041 | m_aceLocation.SetValue(AcePictureBox_2.Location.X, 0, 2) 2042 | m_aceLocation.SetValue(AcePictureBox_2.Location.Y, 1, 2) 2043 | m_aceLocation.SetValue(AcePictureBox_3.Location.X, 0, 3) 2044 | m_aceLocation.SetValue(AcePictureBox_3.Location.Y, 1, 3) 2045 | 2046 | ' Get suits. 2047 | m_suit(0) = CInt(m_aceStacks.GetValue(0, 0, 0)) 2048 | m_suit(1) = CInt(m_aceStacks.GetValue(1, 0, 0)) 2049 | m_suit(2) = CInt(m_aceStacks.GetValue(2, 0, 0)) 2050 | m_suit(3) = CInt(m_aceStacks.GetValue(3, 0, 0)) 2051 | 2052 | m_win2 = True 2053 | m_winX = CInt(m_aceLocation.GetValue(0, 0)) 2054 | m_winY = CInt(m_aceLocation.GetValue(1, 0)) 2055 | m_winStack = 0 2056 | m_winCard = 12 2057 | 2058 | End If 2059 | 2060 | ' Fix transparency issue. 2061 | e.Graphics.FillRegion(New SolidBrush(Color.White), New Region(New Rectangle(m_winX, m_winY, m_cardWidth, m_cardHeight))) 2062 | 2063 | If m_suit(m_winStack) = 0 Then ' Spades. 2064 | e.Graphics.DrawImage(SpadesImageList.Images(m_winCard), m_winX, m_winY) 2065 | ElseIf m_suit(m_winStack) = 1 Then ' Diamonds. 2066 | e.Graphics.DrawImage(DiamondsImageList.Images(m_winCard), m_winX, m_winY) 2067 | ElseIf m_suit(m_winStack) = 2 Then ' Clubs. 2068 | e.Graphics.DrawImage(ClubsImageList.Images(m_winCard), m_winX, m_winY) 2069 | Else ' Hearts. 2070 | e.Graphics.DrawImage(HeartsImageList.Images(m_winCard), m_winX, m_winY) 2071 | End If 2072 | 2073 | WinAlgorithm() 2074 | 2075 | ' Check if at end of window. 2076 | If m_winY + m_cardHeight >= DragBoxPictureBox_1.Height Then 'do new m_bounce 2077 | m_bounce = True 2078 | End If 2079 | If m_winX + m_cardWidth <= 0 OrElse m_winX >= DragBoxPictureBox_1.Width Then 2080 | If m_winStack = 3 Then 2081 | ' Done with win effect. 2082 | If m_winCard = 0 Then 2083 | m_win = False 2084 | ' Clear drag box. 2085 | DragBoxPictureBox_1.Invalidate() 2086 | ' Reset variables. 2087 | m_win2 = False 2088 | ' Play again dialog. 2089 | Dim dialog As New DealAgainDialog 2090 | If dialog.ShowDialog(Me) = DialogResult.Yes Then 2091 | Deal() 2092 | End If 2093 | Else 2094 | m_winCard -= 1 2095 | m_winStack = 0 2096 | m_newWinStack = True 2097 | m_winX = CInt(m_aceLocation.GetValue(0, m_winStack)) 2098 | m_winY = CInt(m_aceLocation.GetValue(1, m_winStack)) 2099 | End If 2100 | ElseIf m_winCard <> 0 OrElse m_winStack <> 3 Then 2101 | m_winStack += 1 2102 | m_newWinStack = True 2103 | m_winX = CInt(m_aceLocation.GetValue(0, m_winStack)) 2104 | m_winY = CInt(m_aceLocation.GetValue(1, m_winStack)) 2105 | End If 2106 | End If 2107 | DragBoxPictureBox_1.Invalidate(New Region(New Rectangle(m_winX, m_winY, m_cardWidth, m_cardHeight)), False) 2108 | Threading.Thread.Sleep(7) 2109 | End Sub 2110 | 2111 | Private Sub WinAlgorithm() 2112 | 2113 | Dim z As Single '= 0 2114 | 2115 | ' NOTE: CARTESIAN COORDINATES ARE REVERSE POSITIVE AND NEGATIVE: 2116 | ' to correct, won't make parabola negative. 2117 | ' PARABOLA FORMULA: m_winY = m_winParabola * (m_winX - m_xVertex) ^ 2 + m_yVertex. 2118 | If m_newWinStack Then ' On new stack, must reset variables. 2119 | 2120 | m_newWinStack = False 2121 | 2122 | ' Pick m_winParabola vertex somewhere in window above 2123 | m_xVertex = m_random.Next(0, 2) 2124 | If m_xVertex = 0 Then 2125 | m_xVertex = m_winX + 24 2126 | Else 2127 | m_xVertex = m_winX - 24 2128 | End If 2129 | m_yVertex = m_random.Next(-m_cardWidth, m_winY) 2130 | 2131 | ' Set m_xMovement (pixels, random), compensate for non-true randomness. 2132 | Dim i = m_random.Next(0, 4) 2133 | If i = 0 Then 2134 | m_xMovement = m_random.Next(-3, -1) 2135 | ElseIf i = 1 Then 2136 | m_xMovement = m_random.Next(2, 4) 2137 | ElseIf i = 2 Then 2138 | i = m_random.Next(0, 2) 2139 | If i = 0 Then 2140 | m_xMovement = m_random.Next(-4, 0) 2141 | Else 2142 | m_xMovement = m_random.Next(-4, -1) 2143 | End If 2144 | Else 2145 | i = m_random.Next(0, 2) 2146 | If i = 0 Then 2147 | m_xMovement = m_random.Next(1, 5) 2148 | Else 2149 | m_xMovement = m_random.Next(2, 5) 2150 | End If 2151 | End If 2152 | 2153 | ' Set m_yMultiplier (4/3, 5/4, or 6/5; float). 2154 | Dim ymultrand = m_random.Next(3, 7) 2155 | m_yMultiplier = (ymultrand + 1.0!) / ymultrand 2156 | 2157 | z = m_winX - m_xVertex 2158 | m_winParabola = (m_winY - m_yVertex) / (z * z) 2159 | 2160 | ElseIf m_bounce Then ' Same stack bounce. 2161 | 2162 | 'Dim newyvertex As Integer = 0 2163 | Dim newxvertex = 0 2164 | 2165 | ' Get new m_yVertex, shift for inverted cartesian coordinates, take percentage, and revert. 2166 | Dim newyvertex = CInt(Math.Ceiling(CSng(DragBoxPictureBox_1.Height) - (CInt(CSng(DragBoxPictureBox_1.Height) - CSng(m_yVertex))) \ CInt(m_yMultiplier))) 2167 | 2168 | ' formula: solve for m_xVertex (note - will get 2 answers keep greater answer if horizontal 2169 | ' move is positive, else keep lesser answer). 2170 | ' 2171 | ' Set old = new: 2172 | ' m_winParabola(m_winX - m_xVertex)(m_winX - m_xVertex) + m_yVertex = m_winParabola(m_winX - newxvertex)(m_winX - newxvertex) + newyvertex. 2173 | ' solve for newxvertex: 2174 | ' newxvertex = -Sqrt((m_winParabola(m_winX - m_xVertex)(m_winX - m_xVertex) + m_yVertex - newyvertex) / m_winParabola) + m_winX. 2175 | z = (m_winParabola * (m_winX - m_xVertex) * (m_winX - m_xVertex) + m_yVertex - newyvertex) / m_winParabola 2176 | If z < 0 OrElse DragBoxPictureBox_1.Height - newyvertex - m_cardHeight < 6 Then ' Too m_small of m_winParabola m_bounce, reduce to 4/5ths of m_winParabola bounce. 2177 | newyvertex = m_yVertex + 4 2178 | z = (m_winParabola * CSng(m_winX - m_xVertex) * (m_winX - m_xVertex) + m_yVertex - newyvertex) / m_winParabola 2179 | End If 2180 | 2181 | Dim xint1 = CInt(-Math.Sqrt(z) + m_winX) 2182 | Dim xint2 = CInt(Math.Sqrt(z) + m_winX) 2183 | 2184 | If m_xMovement > 0 AndAlso xint1 > xint2 Then 2185 | newxvertex = xint1 2186 | ElseIf m_xMovement > 0 AndAlso xint2 > xint1 Then 2187 | newxvertex = xint2 2188 | ElseIf m_xMovement < 0 AndAlso xint1 < xint2 Then 2189 | newxvertex = xint1 2190 | ElseIf m_xMovement < 0 AndAlso xint2 < xint1 Then 2191 | newxvertex = xint2 2192 | ElseIf m_xMovement < 0 AndAlso xint1 = xint2 AndAlso xint1 < m_xVertex Then 2193 | newxvertex = xint1 2194 | ElseIf m_xMovement > 0 AndAlso xint1 = xint2 AndAlso xint1 > m_xVertex Then 2195 | newxvertex = xint1 2196 | Else 2197 | If m_xMovement < 0 Then 2198 | newxvertex = m_xVertex - 1 2199 | End If 2200 | If m_xMovement > 0 Then 2201 | newxvertex = m_xVertex - 1 2202 | End If 2203 | End If 2204 | ' Update vertices. 2205 | m_xVertex = newxvertex 2206 | m_yVertex = newyvertex 2207 | End If 2208 | ' Update m_winX. 2209 | m_winX += m_xMovement 2210 | 2211 | ' Update m_winY. 2212 | z = m_winX - m_xVertex 2213 | If m_winParabola * z * z + m_yVertex > m_winY AndAlso m_bounce Then 2214 | m_winY = m_winY 'BUG: Shouldn't get here. 2215 | Else 2216 | m_winY = CInt(m_winParabola * z * z + m_yVertex) 2217 | End If 2218 | m_bounce = False 2219 | 2220 | End Sub 2221 | 2222 | #End Region 2223 | 2224 | End Class -------------------------------------------------------------------------------- /Solitaire/Ico/sol1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Ico/sol1.ico -------------------------------------------------------------------------------- /Solitaire/Ico/sol2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Ico/sol2.ico -------------------------------------------------------------------------------- /Solitaire/My Project/Application.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.42000 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | 15 | Namespace My 16 | 17 | 'NOTE: This file is auto-generated; do not modify it directly. To make changes, 18 | ' or if you encounter build errors in this file, go to the Project Designer 19 | ' (go to Project Properties or double-click the My Project node in 20 | ' Solution Explorer), and make changes on the Application tab. 21 | ' 22 | Partial Friend Class MyApplication 23 | 24 | _ 25 | Public Sub New() 26 | MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) 27 | Me.IsSingleInstance = false 28 | Me.EnableVisualStyles = true 29 | Me.SaveMySettingsOnExit = true 30 | Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses 31 | Me.HighDpiMode = HighDpiMode.DpiUnaware 32 | End Sub 33 | 34 | _ 35 | Protected Overrides Sub OnCreateMainForm() 36 | Me.MainForm = Global.Solitaire.GameForm 37 | End Sub 38 | 39 | _ 40 | Protected Overrides Function OnInitialize(ByVal commandLineArgs As System.Collections.ObjectModel.ReadOnlyCollection(Of String)) As Boolean 41 | Me.MinimumSplashScreenDisplayTime = 0 42 | Return MyBase.OnInitialize(commandLineArgs) 43 | End Function 44 | End Class 45 | End Namespace 46 | -------------------------------------------------------------------------------- /Solitaire/My Project/Application.myapp: -------------------------------------------------------------------------------- 1 |  2 | 3 | true 4 | GameForm 5 | false 6 | 0 7 | true 8 | 0 9 | true 10 | -------------------------------------------------------------------------------- /Solitaire/OptionsDialog.Designer.vb: -------------------------------------------------------------------------------- 1 |  _ 2 | Partial Class OptionsDialog 3 | Inherits System.Windows.Forms.Form 4 | 5 | 'Form overrides dispose to clean up the component list. 6 | _ 7 | Protected Overrides Sub Dispose(ByVal disposing As Boolean) 8 | Try 9 | If disposing AndAlso components IsNot Nothing Then 10 | components.Dispose() 11 | End If 12 | Finally 13 | MyBase.Dispose(disposing) 14 | End Try 15 | End Sub 16 | 17 | 'Required by the Windows Form Designer 18 | Private components As System.ComponentModel.IContainer 19 | 20 | 'NOTE: The following procedure is required by the Windows Form Designer 21 | 'It can be modified using the Windows Form Designer. 22 | 'Do not modify it using the code editor. 23 | _ 24 | Private Sub InitializeComponent() 25 | Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(OptionsDialog)) 26 | OutlineDraggingCheckBox = New CheckBox() 27 | StatusBarCheckBox = New CheckBox() 28 | TimedGameCheckBox = New CheckBox() 29 | ScoringGroupBox = New GroupBox() 30 | ScoreNoneRadioButton = New RadioButton() 31 | ScoreVegasRadioButton = New RadioButton() 32 | ScoreStandardRadioButton = New RadioButton() 33 | DrawGroupBox = New GroupBox() 34 | DrawThreeRadioButton = New RadioButton() 35 | DrawOneRadioButton = New RadioButton() 36 | CancelActionButton = New Button() 37 | OkButton = New Button() 38 | CummulativeScoreCheckBox = New CheckBox() 39 | HelpProvider = New HelpProvider() 40 | ScoringGroupBox.SuspendLayout() 41 | DrawGroupBox.SuspendLayout() 42 | SuspendLayout() 43 | ' 44 | ' OutlineDraggingCheckBox 45 | ' 46 | OutlineDraggingCheckBox.FlatStyle = FlatStyle.System 47 | HelpProvider.SetHelpString(OutlineDraggingCheckBox, "Specifies that an outline of a card (rather than the actual card) appears while you drag a card to a new location.") 48 | OutlineDraggingCheckBox.Location = New Point(15, 144) 49 | OutlineDraggingCheckBox.Name = "OutlineDraggingCheckBox" 50 | HelpProvider.SetShowHelp(OutlineDraggingCheckBox, True) 51 | OutlineDraggingCheckBox.Size = New Size(130, 30) 52 | OutlineDraggingCheckBox.TabIndex = 4 53 | OutlineDraggingCheckBox.Text = "Outline dragging" 54 | ' 55 | ' StatusBarCheckBox 56 | ' 57 | StatusBarCheckBox.Checked = True 58 | StatusBarCheckBox.CheckState = CheckState.Checked 59 | StatusBarCheckBox.FlatStyle = FlatStyle.System 60 | HelpProvider.SetHelpString(StatusBarCheckBox, "Specifies whether the notification area showing the score and time played will be visible.") 61 | StatusBarCheckBox.Location = New Point(15, 120) 62 | StatusBarCheckBox.Name = "StatusBarCheckBox" 63 | HelpProvider.SetShowHelp(StatusBarCheckBox, True) 64 | StatusBarCheckBox.Size = New Size(96, 29) 65 | StatusBarCheckBox.TabIndex = 3 66 | StatusBarCheckBox.Text = "Status bar" 67 | ' 68 | ' TimedGameCheckBox 69 | ' 70 | TimedGameCheckBox.Checked = True 71 | TimedGameCheckBox.CheckState = CheckState.Checked 72 | TimedGameCheckBox.FlatStyle = FlatStyle.System 73 | HelpProvider.SetHelpString(TimedGameCheckBox, "Specifies whether the game will be timed. To play a more challenging game, click to select Timed game.") 74 | TimedGameCheckBox.Location = New Point(15, 93) 75 | TimedGameCheckBox.Name = "TimedGameCheckBox" 76 | HelpProvider.SetShowHelp(TimedGameCheckBox, True) 77 | TimedGameCheckBox.Size = New Size(106, 29) 78 | TimedGameCheckBox.TabIndex = 2 79 | TimedGameCheckBox.Text = "Timed game" 80 | ' 81 | ' ScoringGroupBox 82 | ' 83 | ScoringGroupBox.Controls.Add(ScoreNoneRadioButton) 84 | ScoringGroupBox.Controls.Add(ScoreVegasRadioButton) 85 | ScoringGroupBox.Controls.Add(ScoreStandardRadioButton) 86 | ScoringGroupBox.FlatStyle = FlatStyle.System 87 | ScoringGroupBox.ForeColor = SystemColors.ActiveCaption 88 | ScoringGroupBox.Location = New Point(140, 14) 89 | ScoringGroupBox.Name = "ScoringGroupBox" 90 | ScoringGroupBox.Size = New Size(115, 96) 91 | ScoringGroupBox.TabIndex = 5 92 | ScoringGroupBox.TabStop = False 93 | ScoringGroupBox.Text = "Scoring" 94 | ' 95 | ' ScoreNoneRadioButton 96 | ' 97 | ScoreNoneRadioButton.FlatStyle = FlatStyle.System 98 | ScoreNoneRadioButton.ForeColor = SystemColors.ControlText 99 | HelpProvider.SetHelpString(ScoreNoneRadioButton, "Specifies the type of scoring to be used. Click None to play without keeping score.") 100 | ScoreNoneRadioButton.Location = New Point(7, 63) 101 | ScoreNoneRadioButton.Name = "ScoreNoneRadioButton" 102 | HelpProvider.SetShowHelp(ScoreNoneRadioButton, True) 103 | ScoreNoneRadioButton.Size = New Size(97, 29) 104 | ScoreNoneRadioButton.TabIndex = 2 105 | ScoreNoneRadioButton.Text = "None" 106 | ' 107 | ' ScoreVegasRadioButton 108 | ' 109 | ScoreVegasRadioButton.FlatStyle = FlatStyle.System 110 | ScoreVegasRadioButton.ForeColor = SystemColors.ControlText 111 | HelpProvider.SetHelpString(ScoreVegasRadioButton, resources.GetString("ScoreVegasRadioButton.HelpString")) 112 | ScoreVegasRadioButton.Location = New Point(7, 39) 113 | ScoreVegasRadioButton.Name = "ScoreVegasRadioButton" 114 | HelpProvider.SetShowHelp(ScoreVegasRadioButton, True) 115 | ScoreVegasRadioButton.Size = New Size(97, 30) 116 | ScoreVegasRadioButton.TabIndex = 1 117 | ScoreVegasRadioButton.Text = "Vegas" 118 | ' 119 | ' ScoreStandardRadioButton 120 | ' 121 | ScoreStandardRadioButton.Checked = True 122 | ScoreStandardRadioButton.FlatStyle = FlatStyle.System 123 | ScoreStandardRadioButton.ForeColor = SystemColors.ControlText 124 | HelpProvider.SetHelpString(ScoreStandardRadioButton, "Specifies the type of scoring to be used. Click Standard to play a game where you start the game with 0 dollars and you win 10 dollars for every card you play on a suit stack.") 125 | ScoreStandardRadioButton.Location = New Point(7, 16) 126 | ScoreStandardRadioButton.Name = "ScoreStandardRadioButton" 127 | HelpProvider.SetShowHelp(ScoreStandardRadioButton, True) 128 | ScoreStandardRadioButton.Size = New Size(97, 30) 129 | ScoreStandardRadioButton.TabIndex = 0 130 | ScoreStandardRadioButton.TabStop = True 131 | ScoreStandardRadioButton.Text = "Standard" 132 | ' 133 | ' DrawGroupBox 134 | ' 135 | DrawGroupBox.Controls.Add(DrawThreeRadioButton) 136 | DrawGroupBox.Controls.Add(DrawOneRadioButton) 137 | DrawGroupBox.FlatStyle = FlatStyle.System 138 | DrawGroupBox.ForeColor = SystemColors.ActiveCaption 139 | DrawGroupBox.Location = New Point(6, 14) 140 | DrawGroupBox.Name = "DrawGroupBox" 141 | DrawGroupBox.Size = New Size(127, 71) 142 | DrawGroupBox.TabIndex = 1 143 | DrawGroupBox.TabStop = False 144 | DrawGroupBox.Text = "Draw" 145 | ' 146 | ' DrawThreeRadioButton 147 | ' 148 | DrawThreeRadioButton.FlatStyle = FlatStyle.System 149 | DrawThreeRadioButton.ForeColor = SystemColors.ControlText 150 | HelpProvider.SetHelpString(DrawThreeRadioButton, "Specifies the number of cards drawn each time you click the deck of cards. Click Draw One to turn over one card at a time, or click Draw Three to turn over three cards at a time.") 151 | DrawThreeRadioButton.Location = New Point(7, 39) 152 | DrawThreeRadioButton.Name = "DrawThreeRadioButton" 153 | HelpProvider.SetShowHelp(DrawThreeRadioButton, True) 154 | DrawThreeRadioButton.Size = New Size(97, 30) 155 | DrawThreeRadioButton.TabIndex = 1 156 | DrawThreeRadioButton.Text = "Draw Three" 157 | ' 158 | ' DrawOneRadioButton 159 | ' 160 | DrawOneRadioButton.Checked = True 161 | DrawOneRadioButton.FlatStyle = FlatStyle.System 162 | DrawOneRadioButton.ForeColor = SystemColors.ControlText 163 | HelpProvider.SetHelpString(DrawOneRadioButton, "Specifies the number of cards drawn each time you click the deck of cards. Click Draw One to turn over one card at a time, or click Draw Three to turn over three cards at a time.") 164 | DrawOneRadioButton.Location = New Point(7, 16) 165 | DrawOneRadioButton.Name = "DrawOneRadioButton" 166 | HelpProvider.SetShowHelp(DrawOneRadioButton, True) 167 | DrawOneRadioButton.Size = New Size(90, 30) 168 | DrawOneRadioButton.TabIndex = 0 169 | DrawOneRadioButton.TabStop = True 170 | DrawOneRadioButton.Text = "Draw One" 171 | ' 172 | ' CancelActionButton 173 | ' 174 | CancelActionButton.DialogResult = DialogResult.Cancel 175 | CancelActionButton.FlatStyle = FlatStyle.System 176 | HelpProvider.SetHelpString(CancelActionButton, "Closes the dialog box without saving any changes you have made.") 177 | CancelActionButton.Location = New Point(140, 181) 178 | CancelActionButton.Name = "CancelActionButton" 179 | HelpProvider.SetShowHelp(CancelActionButton, True) 180 | CancelActionButton.Size = New Size(72, 30) 181 | CancelActionButton.TabIndex = 8 182 | CancelActionButton.Text = "Cancel" 183 | ' 184 | ' OkButton 185 | ' 186 | OkButton.DialogResult = DialogResult.OK 187 | OkButton.FlatStyle = FlatStyle.System 188 | HelpProvider.SetHelpString(OkButton, "Closes the dialog box and saves any changes you have made.") 189 | OkButton.Location = New Point(63, 181) 190 | OkButton.Name = "OkButton" 191 | HelpProvider.SetShowHelp(OkButton, True) 192 | OkButton.Size = New Size(67, 30) 193 | OkButton.TabIndex = 7 194 | OkButton.Text = "OK" 195 | ' 196 | ' CummulativeScoreCheckBox 197 | ' 198 | CummulativeScoreCheckBox.Enabled = False 199 | CummulativeScoreCheckBox.FlatStyle = FlatStyle.System 200 | HelpProvider.SetHelpString(CummulativeScoreCheckBox, "Only available on Vegas scoring, keeps track of your score through multiple games.") 201 | CummulativeScoreCheckBox.Location = New Point(140, 122) 202 | CummulativeScoreCheckBox.Name = "CummulativeScoreCheckBox" 203 | HelpProvider.SetShowHelp(CummulativeScoreCheckBox, True) 204 | CummulativeScoreCheckBox.Size = New Size(106, 40) 205 | CummulativeScoreCheckBox.TabIndex = 6 206 | CummulativeScoreCheckBox.Text = "Cumulative Score" 207 | CummulativeScoreCheckBox.TextAlign = ContentAlignment.TopLeft 208 | ' 209 | ' Form1 210 | ' 211 | AcceptButton = OkButton 212 | AutoScaleMode = AutoScaleMode.Inherit 213 | CancelButton = CancelActionButton 214 | ClientSize = New Size(260, 224) 215 | Controls.Add(OutlineDraggingCheckBox) 216 | Controls.Add(StatusBarCheckBox) 217 | Controls.Add(TimedGameCheckBox) 218 | Controls.Add(ScoringGroupBox) 219 | Controls.Add(DrawGroupBox) 220 | Controls.Add(CancelActionButton) 221 | Controls.Add(OkButton) 222 | Controls.Add(CummulativeScoreCheckBox) 223 | FormBorderStyle = FormBorderStyle.FixedDialog 224 | HelpButton = True 225 | MaximizeBox = False 226 | MaximumSize = New Size(276, 263) 227 | MinimizeBox = False 228 | MinimumSize = New Size(276, 263) 229 | Name = "Form1" 230 | ShowInTaskbar = False 231 | StartPosition = FormStartPosition.CenterParent 232 | Text = "Options" 233 | ScoringGroupBox.ResumeLayout(False) 234 | DrawGroupBox.ResumeLayout(False) 235 | ResumeLayout(False) 236 | End Sub 237 | 238 | Friend WithEvents OutlineDraggingCheckBox As CheckBox 239 | Friend WithEvents HelpProvider As HelpProvider 240 | Friend WithEvents StatusBarCheckBox As CheckBox 241 | Friend WithEvents TimedGameCheckBox As CheckBox 242 | Friend WithEvents ScoringGroupBox As GroupBox 243 | Friend WithEvents ScoreNoneRadioButton As RadioButton 244 | Friend WithEvents ScoreVegasRadioButton As RadioButton 245 | Friend WithEvents ScoreStandardRadioButton As RadioButton 246 | Friend WithEvents DrawGroupBox As GroupBox 247 | Friend WithEvents DrawThreeRadioButton As RadioButton 248 | Friend WithEvents DrawOneRadioButton As RadioButton 249 | Friend WithEvents CancelActionButton As Button 250 | Friend WithEvents OkButton As Button 251 | Friend WithEvents CummulativeScoreCheckBox As CheckBox 252 | End Class 253 | -------------------------------------------------------------------------------- /Solitaire/OptionsDialog.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | Specifies the type of scoring to be used. Click Vegas to play a more challenging game. The object of the Vegas-style game is to earn more money than your wager. You start the game with a debt of 52 dollars and you win 5 dollars for every card you play on the suit stack. 125 | 126 | 127 | True 128 | 129 | -------------------------------------------------------------------------------- /Solitaire/OptionsDialog.vb: -------------------------------------------------------------------------------- 1 | Public Class OptionsDialog 2 | 3 | Private m_originalDraw As Draw = Draw.One 4 | Private m_originalScoring As Scoring = Scoring.Standard 5 | Private m_originalTimedGame As Boolean = True 6 | 7 | Sub OptionsDialog_Load(sender As Object, e As EventArgs) Handles MyBase.Load 8 | ' Cache options when dialog is shown to be able to calculate Redraw property. 9 | m_originalDraw = Draw 10 | m_originalScoring = Scoring 11 | m_originalTimedGame = TimedGame 12 | End Sub 13 | 14 | Private Sub ScoreStandardRadioButton_CheckedChanged(sender As Object, e As EventArgs) Handles ScoreStandardRadioButton.CheckedChanged 15 | CummulativeScoreCheckBox.Enabled = False 16 | End Sub 17 | 18 | Private Sub ScoreVegasRadioButton_CheckedChanged(sender As Object, e As EventArgs) Handles ScoreVegasRadioButton.CheckedChanged 19 | CummulativeScoreCheckBox.Enabled = True 20 | End Sub 21 | 22 | Private Sub ScoreNoneRadioButton_CheckedChanged(sender As Object, e As EventArgs) Handles ScoreNoneRadioButton.CheckedChanged 23 | CummulativeScoreCheckBox.Enabled = False 24 | End Sub 25 | 26 | Friend Property Draw() As Draw 27 | Get 28 | Return If(DrawOneRadioButton.Checked, Draw.One, Draw.Three) 29 | End Get 30 | Set(value As Draw) 31 | DrawOneRadioButton.Checked = (value = Draw.One) 32 | DrawThreeRadioButton.Checked = (value = Draw.Three) 33 | End Set 34 | End Property 35 | 36 | Friend Property Scoring() As Scoring 37 | Get 38 | If ScoreNoneRadioButton.Checked Then 39 | Return Scoring.None 40 | End If 41 | If ScoreStandardRadioButton.Checked Then 42 | Return Scoring.Standard 43 | End If 44 | If ScoreVegasRadioButton.Checked Then 45 | Return CType(IIf(CummulativeScoreCheckBox.Checked, Scoring.VegasCumulative, Scoring.Vegas), Scoring) 46 | End If 47 | Debug.Assert(False) 48 | Return Scoring.None 49 | End Get 50 | Set(Value As Scoring) 51 | ScoreNoneRadioButton.Checked = False 52 | ScoreStandardRadioButton.Checked = False 53 | ScoreVegasRadioButton.Checked = False 54 | CummulativeScoreCheckBox.Checked = False 55 | CummulativeScoreCheckBox.Enabled = False 56 | Select Case Value 57 | Case Scoring.None 58 | ScoreNoneRadioButton.Checked = True 59 | Case Scoring.Standard 60 | ScoreStandardRadioButton.Checked = True 61 | Case Scoring.Vegas 62 | ScoreVegasRadioButton.Checked = True 63 | Case Scoring.VegasCumulative 64 | ScoreVegasRadioButton.Checked = True 65 | CummulativeScoreCheckBox.Checked = True 66 | CummulativeScoreCheckBox.Enabled = True 67 | Case Else 68 | Debug.Assert(False) 69 | End Select 70 | End Set 71 | End Property 72 | 73 | Public Property TimedGame() As Boolean 74 | Get 75 | Return TimedGameCheckBox.Checked 76 | End Get 77 | Set(Value As Boolean) 78 | TimedGameCheckBox.Checked = Value 79 | End Set 80 | End Property 81 | 82 | Public Property StatusBar() As Boolean 83 | Get 84 | Return StatusBarCheckBox.Checked 85 | End Get 86 | Set(Value As Boolean) 87 | StatusBarCheckBox.Checked = Value 88 | End Set 89 | End Property 90 | 91 | Public Property OutlineDragging() As Boolean 92 | Get 93 | Return OutlineDraggingCheckBox.Checked 94 | End Get 95 | Set(Value As Boolean) 96 | OutlineDraggingCheckBox.Checked = Value 97 | End Set 98 | End Property 99 | 100 | Public ReadOnly Property Redeal() As Boolean 101 | Get 102 | If Draw <> m_originalDraw OrElse TimedGame <> m_originalTimedGame Then 103 | Return True 104 | End If 105 | If Scoring <> m_originalScoring Then 106 | ' Vegas -> VegasCummulative or VegasCummulative -> Vegas not worth a redeal. 107 | If Scoring = Scoring.Vegas AndAlso m_originalScoring = Scoring.VegasCumulative Then 108 | Return False 109 | End If 110 | If Scoring = Scoring.VegasCumulative AndAlso m_originalScoring = Scoring.Vegas Then 111 | Return False 112 | End If 113 | Return True 114 | End If 115 | Return False 116 | End Get 117 | End Property 118 | 119 | End Class -------------------------------------------------------------------------------- /Solitaire/Png/AceSpade_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/AceSpade_0.png -------------------------------------------------------------------------------- /Solitaire/Png/AceSpade_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/AceSpade_1.png -------------------------------------------------------------------------------- /Solitaire/Png/AceSpade_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/AceSpade_2.png -------------------------------------------------------------------------------- /Solitaire/Png/AceSpade_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/AceSpade_3.png -------------------------------------------------------------------------------- /Solitaire/Png/AceSpade_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/AceSpade_4.png -------------------------------------------------------------------------------- /Solitaire/Png/AceSpade_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/AceSpade_5.png -------------------------------------------------------------------------------- /Solitaire/Png/CardBack_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/CardBack_0.png -------------------------------------------------------------------------------- /Solitaire/Png/CardBack_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/CardBack_1.png -------------------------------------------------------------------------------- /Solitaire/Png/CardBack_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/CardBack_10.png -------------------------------------------------------------------------------- /Solitaire/Png/CardBack_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/CardBack_11.png -------------------------------------------------------------------------------- /Solitaire/Png/CardBack_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/CardBack_2.png -------------------------------------------------------------------------------- /Solitaire/Png/CardBack_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/CardBack_3.png -------------------------------------------------------------------------------- /Solitaire/Png/CardBack_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/CardBack_4.png -------------------------------------------------------------------------------- /Solitaire/Png/CardBack_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/CardBack_5.png -------------------------------------------------------------------------------- /Solitaire/Png/CardBack_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/CardBack_6.png -------------------------------------------------------------------------------- /Solitaire/Png/CardBack_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/CardBack_7.png -------------------------------------------------------------------------------- /Solitaire/Png/CardBack_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/CardBack_8.png -------------------------------------------------------------------------------- /Solitaire/Png/CardBack_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/CardBack_9.png -------------------------------------------------------------------------------- /Solitaire/Png/CardSlot_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/CardSlot_0.png -------------------------------------------------------------------------------- /Solitaire/Png/CardSlot_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/CardSlot_1.png -------------------------------------------------------------------------------- /Solitaire/Png/CardSlot_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/CardSlot_2.png -------------------------------------------------------------------------------- /Solitaire/Png/Club_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Club_0.png -------------------------------------------------------------------------------- /Solitaire/Png/Club_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Club_1.png -------------------------------------------------------------------------------- /Solitaire/Png/Club_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Club_10.png -------------------------------------------------------------------------------- /Solitaire/Png/Club_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Club_11.png -------------------------------------------------------------------------------- /Solitaire/Png/Club_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Club_12.png -------------------------------------------------------------------------------- /Solitaire/Png/Club_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Club_2.png -------------------------------------------------------------------------------- /Solitaire/Png/Club_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Club_3.png -------------------------------------------------------------------------------- /Solitaire/Png/Club_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Club_4.png -------------------------------------------------------------------------------- /Solitaire/Png/Club_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Club_5.png -------------------------------------------------------------------------------- /Solitaire/Png/Club_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Club_6.png -------------------------------------------------------------------------------- /Solitaire/Png/Club_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Club_7.png -------------------------------------------------------------------------------- /Solitaire/Png/Club_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Club_8.png -------------------------------------------------------------------------------- /Solitaire/Png/Club_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Club_9.png -------------------------------------------------------------------------------- /Solitaire/Png/Diamond_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Diamond_0.png -------------------------------------------------------------------------------- /Solitaire/Png/Diamond_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Diamond_1.png -------------------------------------------------------------------------------- /Solitaire/Png/Diamond_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Diamond_10.png -------------------------------------------------------------------------------- /Solitaire/Png/Diamond_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Diamond_11.png -------------------------------------------------------------------------------- /Solitaire/Png/Diamond_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Diamond_12.png -------------------------------------------------------------------------------- /Solitaire/Png/Diamond_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Diamond_2.png -------------------------------------------------------------------------------- /Solitaire/Png/Diamond_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Diamond_3.png -------------------------------------------------------------------------------- /Solitaire/Png/Diamond_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Diamond_4.png -------------------------------------------------------------------------------- /Solitaire/Png/Diamond_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Diamond_5.png -------------------------------------------------------------------------------- /Solitaire/Png/Diamond_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Diamond_6.png -------------------------------------------------------------------------------- /Solitaire/Png/Diamond_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Diamond_7.png -------------------------------------------------------------------------------- /Solitaire/Png/Diamond_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Diamond_8.png -------------------------------------------------------------------------------- /Solitaire/Png/Diamond_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Diamond_9.png -------------------------------------------------------------------------------- /Solitaire/Png/Heart_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Heart_0.png -------------------------------------------------------------------------------- /Solitaire/Png/Heart_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Heart_1.png -------------------------------------------------------------------------------- /Solitaire/Png/Heart_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Heart_10.png -------------------------------------------------------------------------------- /Solitaire/Png/Heart_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Heart_11.png -------------------------------------------------------------------------------- /Solitaire/Png/Heart_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Heart_12.png -------------------------------------------------------------------------------- /Solitaire/Png/Heart_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Heart_2.png -------------------------------------------------------------------------------- /Solitaire/Png/Heart_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Heart_3.png -------------------------------------------------------------------------------- /Solitaire/Png/Heart_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Heart_4.png -------------------------------------------------------------------------------- /Solitaire/Png/Heart_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Heart_5.png -------------------------------------------------------------------------------- /Solitaire/Png/Heart_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Heart_6.png -------------------------------------------------------------------------------- /Solitaire/Png/Heart_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Heart_7.png -------------------------------------------------------------------------------- /Solitaire/Png/Heart_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Heart_8.png -------------------------------------------------------------------------------- /Solitaire/Png/Heart_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Heart_9.png -------------------------------------------------------------------------------- /Solitaire/Png/Spade_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Spade_0.png -------------------------------------------------------------------------------- /Solitaire/Png/Spade_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Spade_1.png -------------------------------------------------------------------------------- /Solitaire/Png/Spade_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Spade_10.png -------------------------------------------------------------------------------- /Solitaire/Png/Spade_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Spade_11.png -------------------------------------------------------------------------------- /Solitaire/Png/Spade_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Spade_12.png -------------------------------------------------------------------------------- /Solitaire/Png/Spade_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Spade_2.png -------------------------------------------------------------------------------- /Solitaire/Png/Spade_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Spade_3.png -------------------------------------------------------------------------------- /Solitaire/Png/Spade_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Spade_4.png -------------------------------------------------------------------------------- /Solitaire/Png/Spade_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Spade_5.png -------------------------------------------------------------------------------- /Solitaire/Png/Spade_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Spade_6.png -------------------------------------------------------------------------------- /Solitaire/Png/Spade_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Spade_7.png -------------------------------------------------------------------------------- /Solitaire/Png/Spade_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Spade_8.png -------------------------------------------------------------------------------- /Solitaire/Png/Spade_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/Solitaire/Png/Spade_9.png -------------------------------------------------------------------------------- /Solitaire/Solitaire.vbproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | WinExe 5 | net8.0-windows 6 | Solitaire.My.MyApplication 7 | true 8 | WindowsForms 9 | solitaire 10 | 0.0.3.0 11 | 0.0.3.0 12 | Cory Smith 13 | AddressOf.com 14 | (c) 2005-2024, Cory Smith 15 | http://addressof.com 16 | copyused 17 | True 18 | On 19 | en-US 20 | False 21 | False 22 | en-US 23 | Ico\sol2.ico 24 | 'Classic' Solitaire 25 | https://github.com/DualBrain/Solitaire 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | True 37 | True 38 | Application.myapp 39 | 40 | 41 | 42 | 43 | 44 | MyApplicationCodeGenerator 45 | Application.Designer.vb 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /sol.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/sol.ico -------------------------------------------------------------------------------- /solitaire.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DualBrain/Solitaire/b61b42b86fc14c54cf2c8639a765234952579b5f/solitaire.png --------------------------------------------------------------------------------