| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 657 人关注过本帖
标题:求助 窗口上的按键
只看楼主 加入收藏
追梦人zmrghy
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:406
专家分:190
注 册:2021-4-9
结帖率:97.26%
收藏
已结贴  问题点数:20 回复次数:3 
求助 窗口上的按键
图片附件: 游客没有浏览图片的权限,请 登录注册


 这种按键上的图标,还有文字,的效果是如何弄出来的。
按键之间的竖杠 分割线,是如何弄出来的。

图片附件: 游客没有浏览图片的权限,请 登录注册


程序代码:
#pragma once

namespace BoxGame {

    using namespace System;
    using namespace System::ComponentModel;
    using namespace System::Collections;
    using namespace System::Windows::Forms;
    using namespace System::Data;
    using namespace System::Drawing;

    /// <summary>
    /// Form1 摘要
    /// </summary>
    public ref class Form1 : public System::Windows::Forms::Form
    {
    public:
        Form1(void)
        {
            InitializeComponent();
            //
            //TODO: 在此处添加构造函数代码
            //
        }

    protected:
        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        ~Form1()
        {
            if (components)
            {
                delete components;
            }
        }
    private: System::Windows::Forms::TableLayoutPanel^  tableLayoutPanel1;
    protected: 
    private: System::Windows::Forms::Label^  label1;
    private: System::Windows::Forms::Label^  label2;
    private: System::Windows::Forms::Panel^  panel1;
    private: System::Windows::Forms::Panel^  panel2;



    private:
        /// <summary>
        /// 必需的设计器变量。
        /// </summary>
        System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
        /// <summary>
        /// 设计器支持所需的方法 - 不要
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        void InitializeComponent(void)
        {
            System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
            this->tableLayoutPanel1 = (gcnew System::Windows::Forms::TableLayoutPanel());
            this->label1 = (gcnew System::Windows::Forms::Label());
            this->label2 = (gcnew System::Windows::Forms::Label());
            this->panel1 = (gcnew System::Windows::Forms::Panel());
            this->panel2 = (gcnew System::Windows::Forms::Panel());
            this->tableLayoutPanel1->SuspendLayout();
            this->SuspendLayout();
            // 
            // tableLayoutPanel1
            // 
            this->tableLayoutPanel1->CellBorderStyle = System::Windows::Forms::TableLayoutPanelCellBorderStyle::OutsetDouble;
            this->tableLayoutPanel1->ColumnCount = 2;
            this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent, 
                44.6281F)));
            this->tableLayoutPanel1->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent, 
                55.3719F)));
            this->tableLayoutPanel1->Controls->Add(this->label1, 0, 0);
            this->tableLayoutPanel1->Controls->Add(this->label2, 1, 0);
            this->tableLayoutPanel1->Dock = System::Windows::Forms::DockStyle::Bottom;
            this->tableLayoutPanel1->Location = System::Drawing::Point(0, 501);
            this->tableLayoutPanel1->Name = L"tableLayoutPanel1";
            this->tableLayoutPanel1->RowCount = 1;
            this->tableLayoutPanel1->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 50)));
            this->tableLayoutPanel1->Size = System::Drawing::Size(484, 28);
            this->tableLayoutPanel1->TabIndex = 0;
            // 
            // label1
            // 
            this->label1->AutoSize = true;
            this->label1->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
            this->label1->Dock = System::Windows::Forms::DockStyle::Fill;
            this->label1->Location = System::Drawing::Point(6, 3);
            this->label1->Name = L"label1";
            this->label1->Size = System::Drawing::Size(205, 22);
            this->label1->TabIndex = 0;
            this->label1->Text = L"label1";
            // 
            // label2
            // 
            this->label2->AutoSize = true;
            this->label2->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
            this->label2->Dock = System::Windows::Forms::DockStyle::Fill;
            this->label2->Location = System::Drawing::Point(220, 3);
            this->label2->Name = L"label2";
            this->label2->Size = System::Drawing::Size(258, 22);
            this->label2->TabIndex = 1;
            this->label2->Text = L"label2";
            // 
            // panel1
            // 
            this->panel1->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
            this->panel1->Dock = System::Windows::Forms::DockStyle::Top;
            this->panel1->Location = System::Drawing::Point(0, 0);
            this->panel1->Name = L"panel1";
            this->panel1->Size = System::Drawing::Size(484, 51);
            this->panel1->TabIndex = 1;
            // 
            // panel2
            // 
            this->panel2->BackColor = System::Drawing::Color::Black;
            this->panel2->Dock = System::Windows::Forms::DockStyle::Fill;
            this->panel2->Location = System::Drawing::Point(0, 51);
            this->panel2->Name = L"panel2";
            this->panel2->Size = System::Drawing::Size(484, 450);
            this->panel2->TabIndex = 2;
            // 
            // Form1
            // 
            this->AutoScaleDimensions = System::Drawing::SizeF(6, 12);
            this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
            this->ClientSize = System::Drawing::Size(484, 529);
            this->Controls->Add(this->panel2);
            this->Controls->Add(this->panel1);
            this->Controls->Add(this->tableLayoutPanel1);
            this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));
            this->MaximizeBox = false;
            this->MaximumSize = System::Drawing::Size(598, 568);
            this->MinimumSize = System::Drawing::Size(500, 568);
            this->Name = L"Form1";
            this->Text = L"推箱子游戏";
            this->tableLayoutPanel1->ResumeLayout(false);
            this->tableLayoutPanel1->PerformLayout();
            this->ResumeLayout(false);

        }
#pragma endregion
    };
}

搜索更多相关主题的帖子: Windows Add Forms Size System 
2022-08-12 22:13
apull
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:三体星系
等 级:版主
威 望:216
帖 子:1507
专家分:9241
注 册:2010-3-16
收藏
得分:20 
图片附件: 游客没有浏览图片的权限,请 登录注册
2022-08-13 11:55
追梦人zmrghy
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:406
专家分:190
注 册:2021-4-9
收藏
得分:0 
回复 2楼 apull
多谢指教。。。
按键已经完成了。。。
图片附件: 游客没有浏览图片的权限,请 登录注册


新的问题又来了!!!
窗口底部,应该使用状态栏。
如果使用状态栏,增加toolStripStatusLabel, Label的宽度是自动的,需要显示字符多长,Label宽度就多长。
原游戏,底部的效果是如何实现的呀
2022-08-14 13:41
追梦人zmrghy
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:406
专家分:190
注 册:2021-4-9
收藏
得分:0 
回复 2楼 apull
麻烦你了,我又找到答案了。。。

图片附件: 游客没有浏览图片的权限,请 登录注册
2022-08-14 14:06
快速回复:求助 窗口上的按键
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.032680 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved