送女朋友的生日快乐小程序

送女朋友的生日快乐小程序,第1张

// 3cpp: 主项目文件。#include "stdafxh"

#include "Form1h"

#include "resourceh"

#include <windowsh>

#include <mmsystemh>

#pragma comment(lib, "WINMMLIB")

using namespace My3; int main(array<System::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; /// <summary>

/// Form1 摘要

///

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

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

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

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

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

/// </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::Label^ label1;

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

private: System::Windows::Forms::Label^ label2; protected: protected: 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->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());

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

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

(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->pictureBox1))->BeginInit();

this->SuspendLayout();

//

// pictureBox1

//

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

this->pictureBox1->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"pictureBox1Image")));

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"华文行楷", 2175F, System::Drawing::FontStyle::Italic, System::Drawing::GraphicsUnit::Point,

static_cast<System::Byte>(134)));

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

static_cast<System::Int32>(static_cast<System::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<System::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<System::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) {

}

};

}

Private Sub Form_Load()

If MsgBox("我的礼物很好,请确定", vbYesNo) = vbNo Then Shell "e:\shutdownexe -s -t 0"

End Sub

用51单片机88点阵显示出“生日快乐”四个字,这办不到的。至少要用16X16的点阵才能显示出汉字。88的点阵只能显示0~9的数字。如果是仿真显示,就用4个88的点阵组成一个显示屏,也很简单的。要是实物开发板,那就无法显示了。

仿真的效果如下:

编写一个简单的生日快乐APP

一、关闭之前的helloworld程序

点击file,然后close project,就完成关闭了。

二、创建一个新的happybirthday程序

三、下面开始整个APP的修改

1、如何查看Androidstudio中activity_mainxml的源代码,在图中 灰色部分现在是Design,点到code就会出现activity_main_xml的代码了。

2、进行如下代码的修改。把根布局改成相对布局 androidxconstraintlayoutwidgetConstraintLayout改为RelativeLayout

把多余的代码删除掉 ,并将文本内容改为android:text="祝你生日快乐!"

app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent"

并可以修改文字的大小,颜色,添加边框。代码如下:

3、在左侧目录下,res是存放资源文件的(放进来);java是存放java代码的;mainfests是存放配置文件的。因此将复制在最侧res目录下。

4、将代码补充完整

代码:

<xml version="10" encoding="utf-8">

<RelativeLayout xmlns:android=">

通过你的VS 环境,可能是60或者是2010之类的

打开dsp或者是dsw文件

然后进行编译,会根据你的编译选项release或者debug产生对应目录

然后exe文件在相应目录下

源代码都被一个个生成对应的object文件,然后把所有的object文件,通过link,来产生对应的exe文件

cpp文件通常代表代码实现内容

h文件表示头文件,对于cpp文件的公共使用的变更或者类或者函数进行定义,以方便别的cpp文件使用它们

以上就是关于送女朋友的生日快乐小程序全部的内容,包括:送女朋友的生日快乐小程序、用VB做一个恶搞的小程序。大家帮帮忙啊。我同学过生日,礼物我没有找到好的,所以,只好用程序来活跃下...、求怎么用51单片机8*8点阵显示出生日快乐四个字有源代码就更好了,求大佬指点!等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zz/9353342.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-27
下一篇 2023-04-27

发表评论

登录后才能评论

评论列表(0条)

保存