private void populate( ComboBoxWithIcons ort ) { String pop = "CreativeModePlus.res.block_icons.rails."; Stream file = Asm.exe.GetManifestResourceStream( pop + "0.png" ); ort.Add( "North-South", Image.FromStream( file ), -1 ); file.Close(); file = Asm.exe.GetManifestResourceStream( pop + "1.png" ); ort.Add( "East-West", Image.FromStream( file ), -1 ); file.Close(); file = Asm.exe.GetManifestResourceStream( pop + "1.png" ); ort.Add( "Ascend East", Image.FromStream( file ), -1 ); file.Close(); file = Asm.exe.GetManifestResourceStream( pop + "1.png" ); ort.Add( "Ascend West", Image.FromStream( file ), -1 ); file.Close(); file = Asm.exe.GetManifestResourceStream( pop + "0.png" ); ort.Add( "Ascend North", Image.FromStream( file ), -1 ); file.Close(); file = Asm.exe.GetManifestResourceStream( pop + "0.png" ); ort.Add( "Ascend South", Image.FromStream( file ), -1 ); file.Close(); file = Asm.exe.GetManifestResourceStream( pop + "2.png" ); ort.Add( "South to East", Image.FromStream( file ), -1 ); file.Close(); file = Asm.exe.GetManifestResourceStream( pop + "3.png" ); ort.Add( "South to West", Image.FromStream( file ), -1 ); file.Close(); file = Asm.exe.GetManifestResourceStream( pop + "4.png" ); ort.Add( "North to West", Image.FromStream( file ), -1 ); file.Close(); file = Asm.exe.GetManifestResourceStream( pop + "5.png" ); ort.Add( "North to East", Image.FromStream( file ), -1 ); file.Close(); }
private int makeRails() { int toRet = 0; ComboBoxWithIcons ort = new ComboBoxWithIcons(); Label opt = new Label(); Size = new Size( 200, 120 ); // Set Item Text opt.Text = "Rail Options"; // Set Item Configuation ort.DropDownStyle = ComboBoxStyle.DropDownList; ort.DrawMode = DrawMode.OwnerDrawFixed; populate( ort ); Controls.AddRange( new Control[]{ opt, ort }); // Set Locations opt.Location = new Point( 12, 9 ); ort.Location = new Point( 15, 29 ); btnData.Location = new Point( 15, 55 ); ort.SelectedIndex = 0; ShowDialog(); toRet = ort.SelectedIndex; return toRet; }