
namespace WindowsFormsApplication11{public partial class Form1 : Form{public Form1(){InitializeComponent();System.Collections.ArrayList rooms = new System.Collections.ArrayList();rooms.Add(new Room(\"93#\", 5));rooms.Add(new Room(\"95#\", 6));rooms.Add(new Room(\"97#\", 7));rooms.Add(new Room(\"99#\", 8));cbRoom.DataSource = rooms;cbRoom.DisplayMember = \"RoomType\";cbRoom.ValueMember = \"Price\";}public class Room{public string RoomType { get; set; }public decimal Price { get; set; }public Room(string type, decimal price){this.RoomType = type;this.Price = price;}}private void button1_Click(object sender, EventArgs e){int number = int.Parse(textBox2.Text);decimal price = (decimal)cbRoom.SelectedValue;decimal a = (decimal)number * price;textBox3.Text = a.ToString(\"c\");}}}
		 爱站程序员基地
爱站程序员基地
![(原创)[C#] 一步一步自定义拖拽(Drag&Drop)时的鼠标效果:(一)基本原理及基本实现-爱站程序员基地](https://aiznh.com/wp-content/uploads/2022/07/20220721231016-62d9dcd85c40b-220x150.gif)

