java简单小程序 生日快乐,跪求一祝福别人生日快乐小程序

这是一个简单的Java程序,用于创建一个生日祝福的小窗体应用。程序会在启动时播放生日快乐歌,并显示带有个性化祝福信息的窗口。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

送女朋友生日快乐小程序

// 3.cpp: 主项目文件。#include "stdafx.h"

#include "Form1.h"

#include "resource.h"

#include

#include

#pragma comment(lib, "WINMM.LIB")

using namespace My3; int main(array<:string> ^args)

{

// 在创建任何控件之前启用 Windows XP 可视化效果

Application::EnableVisualStyles();

Application::SetCompatibleTextRenderingDefault(false);

// 创建主窗口并运行它

PlaySound(MAKEINTRESOURCE(IDR_WAVE1),GetModuleHandle(0),SND_RESOURCE|SND_ASYNC );

Application::Run(gcnew Form1());

return 0;

}

//Form#pragma once

namespace My3 { using namespace System;

using namespace System::ComponentModel;

using namespace System::Collections;

using namespace System::Windows::Forms;

using namespace System::Data;

using namespace System::Drawing; ///

/// Form1 摘要

///

/// 警告: 如果更改此类的名称,则需要更改

/// 与此类所依赖的所有 .resx 文件关联的托管资源编译器工具的

/// “资源文件名”属性。否则,

/// 设计器将不能与此窗体的关联

/// 本地化资源正确交互。

///

public ref class Form1 : public System::Windows::Forms::Form

{

public:

Form1(void)

{

InitializeComponent();

//

//TODO: 在此处添加构造函数代码

//

} protected:

///

/// 清理所有正在使用的资源。

///

~Form1()

{

if (components)

{

delete components;

}

} private: System::Windows::Forms::Label^ label1;

private: System::Windows::Forms::PictureBox^ pictureBox1;

private: System::Windows::Forms::Label^ label2; protected: protected: private:

///

/// 必需的设计器变量。

///

System::ComponentModel::Container ^components;#pragma region Windows Form Designer generated code

///

/// 设计器支持所需的方法 - 不要

/// 使用代码编辑器修改此方法的内容。

///

void InitializeComponent(void)

{

System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));

this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());

this->label1 = (gcnew System::Windows::Forms::Label());

this->label2 = (gcnew System::Windows::Forms::Label());

(cli::safe_cast<:componentmodel::isupportinitialize>(this->pictureBox1))->BeginInit();

this->SuspendLayout();

//

// pictureBox1

//

this->pictureBox1->BackColor = System::Drawing::SystemColors::Desktop;

this->pictureBox1->Image = (cli::safe_cast<:drawing::image>(resources->GetObject(L"pictureBox1.Image")));

this->pictureBox1->Location = System::Drawing::Point(-5, -22);

this->pictureBox1->Name = L"pictureBox1";

this->pictureBox1->Size = System::Drawing::Size(659, 432);

this->pictureBox1->TabIndex = 0;

this->pictureBox1->TabStop = false;

//

// label1

//

this->label1->AutoSize = true;

this->label1->BackColor = System::Drawing::SystemColors::Control;

this->label1->Font = (gcnew System::Drawing::Font(L"华文行楷", 21.75F, System::Drawing::FontStyle::Italic, System::Drawing::GraphicsUnit::Point,

static_cast<:byte>(134)));

this->label1->ForeColor = System::Drawing::Color::FromArgb(static_cast<:int32>(static_cast<:byte>(0)), static_cast<:int32>(static_cast<:byte>(0)),

static_cast<:int32>(static_cast<:byte>(192)));

this->label1->Location = System::Drawing::Point(451, 340);

this->label1->Name = L"label1";

this->label1->Size = System::Drawing::Size(184, 30);

this->label1->TabIndex = 1;

this->label1->Text = L"最爱你的睿~ ";

this->label1->Click += gcnew System::EventHandler(this, &Form1::label1_Click);

//

// label2

//

this->label2->AutoSize = true;

this->label2->Font = (gcnew System::Drawing::Font(L"华文新魏", 24, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,

static_cast<:byte>(134)));

this->label2->Location = System::Drawing::Point(3, 9);

this->label2->Name = L"label2";

this->label2->Size = System::Drawing::Size(185, 33);

this->label2->TabIndex = 2;

this->label2->Text = L"亲爱的嘉悦:";

this->label2->Click += gcnew System::EventHandler(this, &Form1::label2_Click);

//

// Form1

//

this->AutoScaleDimensions = System::Drawing::SizeF(6, 12);

this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;

this->ClientSize = System::Drawing::Size(647, 405);

this->Controls->Add(this->label2);

this->Controls->Add(this->label1);

this->Controls->Add(this->pictureBox1);

this->MaximizeBox = false;

this->MaximumSize = System::Drawing::Size(663, 441);

this->MinimumSize = System::Drawing::Size(663, 441);

this->Name = L"Form1";

this->Text = L"生日快乐";

this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);

(cli::safe_cast<:componentmodel::isupportinitialize>(this->pictureBox1))->EndInit();

this->ResumeLayout(false);

this->PerformLayout(); }

#pragma endregion

private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {

}

private: System::Void panel1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {

}

private: System::Void label1_Click(System::Object^ sender, System::EventArgs^ e) {

}

private: System::Void label2_Click(System::Object^ sender, System::EventArgs^ e) {

}

};

}

收起

6f93e2c92fc5e58e2ec18df1db0b9f08.png

阅读全文

9ded402a52cdd2b9481e864a5093252c.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值