piątek, 31 marca 2017

Prime numbers. Analysis of depedency. C++.

First 50th prime numbers and depedency. Interesting 109 and 113. 






bool __fastcall is_First(int x);
int *first_value;
int *step;
int *new_value;
int *how_many_first;
float *float_value;
float *float_value2;
float *sqrt_value;
float *sqrt_value2;
float *div_sqrt;
float *div_sqrt2;
float *end_sqrt;

bool __fastcall TForm1::is_First(int x)
{
int i,sum;
sum=0;
for(i=1;i<x+1;i++)
{
if(x%i==0)
 ++sum;
}
if(sum==2)
return true;
else
return false;

}
void __fastcall TForm1::FormCreate(TObject *Sender)
{
  init_Random();
  first_value=new int[50];
  step=new int[50];
  new_value=new int[50];
  how_many_first=new int[50];
  float_value=new float[50];
  float_value2=new float[50];
  sqrt_value=new float[50];
  sqrt_value2=new float[50];
  div_sqrt=new float[50];
  div_sqrt2=new float[50];
  end_sqrt=new float[50];


}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
 delete first_value;
 delete step;
 delete new_value;
 delete how_many_first;
 delete float_value;
 delete float_value2;
 delete sqrt_value;
 delete sqrt_value2;
 delete div_sqrt;
 delete div_sqrt2;
 delete end_sqrt;
 Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{

 int i,j,k;
 i=0;
 k=0;
 j=2;
 UnicodeString text[50];
 do
 {
  if(is_First(j))
  {
 first_value[i]=j;
 step[i]=k;
 ++i;

 k=1;
  }
  else
   ++k;

  ++j;
 }while(i<50);
 for(i=0;i<50;i++)
 {
  ListBox1->Items->Add(IntToStr(i+1)+" - "+IntToStr(first_value[i]));
  ListBox2->Items->Add(IntToStr(step[i]));
  text[i]=IntToStr(first_value[i])+IntToStr(step[i]);
  ListBox3->Items->Add(text[i]);
  new_value[i]=StrToInt(text[i]);
 }
 i=0;
 do
 {
  j=2;
  k=0;
  do
  {
if(is_First(j))
++k;
++j;
  }while(j<new_value[i]);
   how_many_first[i]=k;
++i;
 }while(i<50);
 for(i=0;i<50;i++)
 {
  ListBox4->Items->Add(IntToStr(how_many_first[i]));
  float_value[i]=(1.*new_value[i])/(1.*how_many_first[i]);
  ListBox5->Items->Add(FloatToStr(float_value[i]));
  float_value2[i]=(1.*float_value[i]*first_value[i]);
  ListBox6->Items->Add(FloatToStr(float_value2[i]));
  sqrt_value[i]=sqrt(float_value2[i]);
  sqrt_value2[i]=sqrt(1.*first_value[i]);
  div_sqrt[i]=sqrt_value[i]/sqrt_value2[i];
  ListBox7->Items->Add(FloatToStr(sqrt_value[i]));
  ListBox8->Items->Add(FloatToStr(sqrt_value2[i]));
  ListBox9->Items->Add(FloatToStr(div_sqrt[i]));
  div_sqrt2[i]=sqrt(1.*(step[i]+first_value[i]));
  ListBox10->Items->Add(FloatToStr(div_sqrt2[i]));
  end_sqrt[i]=div_sqrt2[i]/sqrt_value2[i];
  ListBox11->Items->Add(FloatToStr(end_sqrt[i]));
 }
}



niedziela, 26 marca 2017

class about application

#include <vcl.h>
#ifndef class_infoH
#define class_infoH
//---------------------------------------------------------------------------

class info_Application
{
private:
UnicodeString file_name;
TSearchRec attribute;
UnicodeString directory;
UnicodeString extract_file;
UnicodeString symbol_disc;
UnicodeString path_file;
int size_file;
UnicodeString last_modification;
public:
info_Application(UnicodeString file);
void show_Informations(TListBox *l_box);
};


#endif




#include <vcl.h>
#pragma hdrstop

#include "class_info.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)

info_Application::info_Application(UnicodeString file)
{

  file_name=file;
  directory=ExtractFileDir(file_name);
  extract_file=ExtractFileName(file_name);
  symbol_disc=ExtractFileDrive(file_name);
  path_file=ExtractRelativePath(GetCurrentDir(),file_name);
  size_file=attribute.Size;
  last_modification=UnicodeString(DateTimeToStr(FileDateToDateTime(attribute.Time)));



}
void info_Application::show_Informations(TListBox *l_box)
{
 l_box->Items->Add("Application name: "+file_name);
 l_box->Items->Add("Directory: "+directory);
 l_box->Items->Add("Extract file: "+extract_file);
 l_box->Items->Add("Disc: "+symbol_disc);
 l_box->Items->Add("Path: "+path_file);
 l_box->Items->Add("Size: "+IntToStr(size_file));
 l_box->Items->Add("Date last modification: " +last_modification);

}

sobota, 25 marca 2017

class Directory (linux/g++)

#include <iostream>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h>

using namespace std;

class Directory
{
    private:
     char *name_of_path;
     char *temp;
     char end;
     size_t size_path;
     DIR *directory;
     struct dirent *my_entry;
     char base_path[PATH_MAX];
    public:
    Directory(char *name);
    bool is_Socket();
    bool is_Normal();
    bool is_Fifo();
    bool is_Directory();
    bool is_Block();
    bool is_Char();
    char *info_Path();
    void directory_Info();
};
Directory::Directory(char *name)
{
    name_of_path=name;
    end='/';
    directory=opendir(name_of_path);
}
bool Directory::is_Socket()
{
    struct stat info;
    lstat(name_of_path,&info);
    if(S_ISSOCK(info.st_mode))
     return true;
    else
     return false;
}
bool Directory::is_Normal()
{
    struct stat info;
    lstat(name_of_path,&info);
    if(S_ISREG(info.st_mode))
     return true;
    else
     return false;
   
}
bool Directory::is_Fifo()
{
    struct stat info;
    lstat(name_of_path,&info);
    if(S_ISFIFO(info.st_mode))
     return true;
    else
     return false;
}
bool Directory::is_Directory()
{
    struct stat info;
    lstat(name_of_path,&info);
    if(S_ISDIR(info.st_mode))
     return true;
    else
     return false;
}
bool Directory::is_Block()
{
    struct stat info;
    lstat(name_of_path,&info);
    if(S_ISBLK(info.st_mode))
     return true;
    else
     return false;
}
bool Directory::is_Char()
{
    struct stat info;
    lstat(name_of_path,&info);
    if(S_ISCHR(info.st_mode))
     return true;
    else
     return false;
}
char *Directory::info_Path()
{
    if (is_Char())
    {
        return "dev char";
    }
    else if (is_Block())
    {
        return "dev blocket";
    }
    else if (is_Directory())
    {
        return "directory";
    }
    else if (is_Fifo())
    {
        return "fifo";
    }
    else if (is_Normal())
    {
        return "normal file";
    }
    else
    {
        "another";
    }
}
void Directory::directory_Info()
{
    strncpy(base_path,name_of_path,sizeof(base_path));
    size_path=strlen(name_of_path);
    if(base_path[size_path-1]!=end)
    {
        base_path[size_path]=end;
        base_path[size_path+1]='\0';
        ++size_path;
    }
    do
    {
        strncpy(base_path+size_path,my_entry->d_name,sizeof(base_path)-size_path);
        temp=info_Path();
        cout<<temp<<"  -  "<<base_path<<endl;
    }while((my_entry=readdir(directory))!=NULL);
    closedir(directory);
}

piątek, 24 marca 2017

My class read binary files in listBox (Visual C++)

read_Files.h


#pragma once

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

ref class read_Files
{
private:
BinaryReader^ date_file;
ListBox^ lb;
String^ name_my_file;
FileStream^ my_file;
System::Single date;
public:
read_Files(String^ name_file,ListBox^ lbox);
void Read();
};

read_Files.cpp

#include "StdAfx.h"
#include "read_Files.h"

read_Files::read_Files(String^ name_file,ListBox^ lbox)
{
name_my_file=name_file;
lb=lbox;
}
void read_Files::Read()
{
 my_file=File::OpenRead(name_my_file);
 date_file=gcnew BinaryReader(my_file,System::Text::Encoding::Default);
 do
 {
date=date_file->ReadSingle();
lb->Items->Add(date.ToString());
 }while(date_file->PeekChar()!=-1);
 my_file->Close();
}

wchar_t, UnicodeString (example)





void __fastcall TForm1::Button1Click(TObject *Sender)
{
 UnicodeString days[7];
 UnicodeString upper_days[7];
 UnicodeString lower_days[7];
 int length_Days[7];

 int i;
 days[0]="Monday";
 days[1]="Tuesday";
 days[2]="Wednesday";
 days[3]="Thursday";
 days[4]="Friday";
 days[5]="Saturday";
 days[6]="Sunday";
 length_Days[0]=days[0].Length();
 length_Days[1]=days[1].Length();
 length_Days[2]=days[2].Length();
 length_Days[3]=days[3].Length();
 length_Days[4]=days[4].Length();
 length_Days[5]=days[5].Length();
 length_Days[6]=days[6].Length();
 wchar_t *Monday=new wchar_t[length_Days[0]];
 wchar_t *Tuesday=new wchar_t[length_Days[1]];
 wchar_t *Wednesday=new wchar_t[length_Days[2]];
 wchar_t *Thursday=new wchar_t[length_Days[3]];
 wchar_t *Friday=new wchar_t[length_Days[4]];
 wchar_t *Saturday=new wchar_t[length_Days[5]];
 wchar_t *Sunday=new wchar_t[length_Days[6]];
 wchar_t *u_Monday=new wchar_t[length_Days[0]];
 wchar_t *u_Tuesday=new wchar_t[length_Days[1]];
 wchar_t *u_Wednesday=new wchar_t[length_Days[2]];
 wchar_t *u_Thursday=new wchar_t[length_Days[3]];
 wchar_t *u_Friday=new wchar_t[length_Days[4]];
 wchar_t *u_Saturday=new wchar_t[length_Days[5]];
 wchar_t *u_Sunday=new wchar_t[length_Days[6]];
 wchar_t *sum_Monday=new wchar_t[2*length_Days[0]+1];
 wchar_t *sum_Tuesday=new wchar_t[2*length_Days[1]+1];
 wchar_t *sum_Wednesday=new wchar_t[2*length_Days[2]+1];
 wchar_t *sum_Thursday=new wchar_t[2*length_Days[3]+1];
 wchar_t *sum_Friday=new wchar_t[2*length_Days[4]+1];
 wchar_t *sum_Saturday=new wchar_t[2*length_Days[5]+1];
 wchar_t *sum_Sunday=new wchar_t[2*length_Days[6]+1];
 Monday=days[0].c_str();
 Tuesday=days[1].c_str();
 Wednesday=days[2].c_str();
 Thursday=days[3].c_str();
 Friday=days[4].c_str();
 Saturday=days[5].c_str();
 Sunday=days[6].c_str();
 u_Monday[length_Days[0]]='\0';
 u_Tuesday[length_Days[1]]='\0';
 u_Wednesday[length_Days[2]]='\0';
 u_Thursday[length_Days[3]]='\0';
 u_Friday[length_Days[4]]='\0';
 u_Saturday[length_Days[5]]='\0';
 u_Sunday[length_Days[6]]='\0';
 for(i=0;i<length_Days[0];i++)
  u_Monday[i]=Monday[length_Days[0]-1-i];
 for(i=0;i<length_Days[1];i++)
  u_Tuesday[i]=Tuesday[length_Days[1]-1-i];
 for(i=0;i<length_Days[2];i++)
  u_Wednesday[i]=Wednesday[length_Days[2]-1-i];
 for(i=0;i<length_Days[3];i++)
  u_Thursday[i]=Thursday[length_Days[3]-1-i];
 for(i=0;i<length_Days[4];i++)
  u_Friday[i]=Friday[length_Days[4]-1-i];
 for(i=0;i<length_Days[5];i++)
  u_Saturday[i]=Saturday[length_Days[5]-1-i];
 for(i=0;i<length_Days[6];i++)
  u_Sunday[i]=Sunday[length_Days[6]-1-i];
 wcscpy(sum_Monday,Monday);
 wcscat(sum_Monday,u_Monday);
 wcscpy(sum_Tuesday,Tuesday);
 wcscat(sum_Tuesday,u_Tuesday);
 wcscpy(sum_Wednesday,Wednesday);
 wcscat(sum_Wednesday,u_Wednesday);
 wcscpy(sum_Thursday,Thursday);
 wcscat(sum_Thursday,u_Thursday);
 wcscpy(sum_Friday,Friday);
 wcscat(sum_Friday,u_Friday);
 wcscpy(sum_Saturday,Saturday);
 wcscat(sum_Saturday,u_Saturday);
 wcscpy(sum_Sunday,Sunday);
 wcscat(sum_Sunday,u_Sunday);
 upper_days[0]=UpperCase(UnicodeString(sum_Monday));
 lower_days[0]=LowerCase(UnicodeString(sum_Monday));
 upper_days[1]=UpperCase(UnicodeString(sum_Tuesday));
 lower_days[1]=LowerCase(UnicodeString(sum_Tuesday));
 upper_days[2]=UpperCase(UnicodeString(sum_Wednesday));
 lower_days[2]=LowerCase(UnicodeString(sum_Wednesday));
 upper_days[3]=UpperCase(UnicodeString(sum_Thursday));
 lower_days[3]=LowerCase(UnicodeString(sum_Thursday));
 upper_days[4]=UpperCase(UnicodeString(sum_Friday));
 lower_days[4]=LowerCase(UnicodeString(sum_Friday));
 upper_days[5]=UpperCase(UnicodeString(sum_Saturday));
 lower_days[5]=LowerCase(UnicodeString(sum_Saturday));
 upper_days[6]=UpperCase(UnicodeString(sum_Sunday));
 lower_days[6]=LowerCase(UnicodeString(sum_Sunday));

 Edit1->Text=days[0];
 Edit2->Text=days[1];
 Edit3->Text=days[2];
 Edit4->Text=days[3];
 Edit5->Text=days[4];
 Edit6->Text=days[5];
 Edit7->Text=days[6];
 Edit8->Text=IntToStr(length_Days[0]);
 Edit9->Text=IntToStr(length_Days[1]);
 Edit10->Text=IntToStr(length_Days[2]);
 Edit11->Text=IntToStr(length_Days[3]);
 Edit12->Text=IntToStr(length_Days[4]);
 Edit13->Text=IntToStr(length_Days[5]);
 Edit14->Text=IntToStr(length_Days[6]);
 Edit15->Text=u_Monday;
 Edit16->Text=u_Tuesday;
 Edit17->Text=u_Wednesday;
 Edit18->Text=u_Thursday;
 Edit19->Text=u_Friday;
 Edit20->Text=u_Saturday;
 Edit21->Text=u_Sunday;
 Edit22->Text=sum_Monday;
 Edit23->Text=sum_Tuesday;
 Edit24->Text=sum_Wednesday;
 Edit25->Text=sum_Thursday;
 Edit26->Text=sum_Friday;
 Edit27->Text=sum_Saturday;
 Edit28->Text=sum_Sunday;
 for(i=0;i<7;i++)
 {
   ListBox1->Items->Add(upper_days[i]);
   ListBox2->Items->Add(lower_days[i]);
 }


}

niedziela, 19 marca 2017

WinExec and ShellExecute in class (C++ Builder)


#include <vcl.h>
#include <ShellApi.h>

class my_Execute
{
private:

wchar_t *temp;

UnicodeString text;
public:
my_Execute(TEdit *edit);
void run_WinExec();
void run_ShellExecute();

};


my_Execute::my_Execute(TEdit *edit)
{
 temp=edit->Text.c_str();
 text=edit->Text;
}

void my_Execute::run_WinExec()
{
char *value;
wcstombs(value,temp,24);
WinExec(value,SW_NORMAL);
}

void my_Execute::run_ShellExecute()
{

  ShellExecute(Application->Handle,("open"),LPCSTR(temp),NULL,NULL,SW_SHOWNORMAL);
}

Environment linux in class (g++)

#include <iostream>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>

using namespace std;
 

class linux_Environment
{
    private:
    size_t my_Size;
    char *text_Filename;
    char *size_linux_Directory;
    pid_t my_Pid;
    char *text_directory;
    int file;
    public:
    linux_Environment(char *directory)
    {
        text_directory="/proc/%d/environ";
        size_linux_Directory=new char[20000];
        text_Filename=new char[96];
        my_Pid=(pid_t) atoi(directory);
        snprintf(text_Filename,sizeof(text_Filename),text_directory,(int)my_Pid);
        file=open(text_Filename,O_RDONLY);
        my_Size=read(file,size_linux_Directory,sizeof(size_linux_Directory));
        close(file);
       
    }
    void write_Environment()
    {
        char *temp;
        size_linux_Directory[my_Size]='\0';
        temp=size_linux_Directory;
        do
        {
            cout<<temp<<endl;
            temp=temp+strlen(temp)+1;
        }while(temp<size_linux_Directory+my_Size);
    }
    ~linux_Environment()
    {
        delete size_linux_Directory;
        delete text_Filename;
    }
};

Class get_Files in Visual C++

#pragma once
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::IO;

ref class get_Files
{
private:
String^ Directory;
array<String^>^files;
public:
get_Files(String^ my_Directory);
System::Void write_Files(ListBox^ my_Box);
};



#include "StdAfx.h"
#include "get_Files.h"

get_Files::get_Files(String^ my_Directory)
{
Directory=my_Directory;
files=Directory::GetFiles(Directory ,"*.*",System::IO::SearchOption::AllDirectories;

}
System::Void get_Files::write_Files(ListBox^ my_Box)
{
System::Int32 i;
my_Box=gcnew ListBox;

for(i=0;i<files->Length;i++)
my_Box->Items->Add(files[i]);
}

piątek, 17 marca 2017

FTP Visual C++



#pragma endregion
Uri^ WWW_Ftp;
StreamReader^ SR;
FtpWebResponse^ date;
FtpWebRequest^ infoFiles;
Stream^ Str;
FileStream^ download_File;
System::Int32 size_Files;
array<Byte>^ size_Byte;

private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
size_Byte=gcnew array<Byte>(2048);
}


private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
 listBox1->Items->Clear();
String^ text;
String^ text_Credential1="anonymous";
String^ text_Credential2="lukasz.wierzbicki2@gmail.com";
text=textBox1->Text;
WWW_Ftp=gcnew Uri("ftp://"+text);
infoFiles=dynamic_cast<FtpWebRequest^>(WebRequest::Create(WWW_Ftp));
infoFiles->Credentials=gcnew NetworkCredential(text_Credential1,text_Credential2);
infoFiles->Method=WebRequestMethods::Ftp::ListDirectoryDetails;
date=dynamic_cast<FtpWebResponse^>(infoFiles->GetResponse());
Str=date->GetResponseStream();
SR=gcnew StreamReader(Str);
do
{
listBox1->Items->Add(SR->ReadLine());
}while(!SR->EndOfStream);
}
private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
Close();
}
private: System::Void button3_Click(System::Object^  sender, System::EventArgs^  e) {
String^ text_Files;
String^ text_Credential1="anonymous";
String^ text_Credential2="lukasz.wierzbicki2@gmail.com";
text_Files="ftp://"+textBox1->Text+"/"+textBox2->Text;
WWW_Ftp=gcnew Uri(text_Files);
infoFiles=dynamic_cast<FtpWebRequest^>(WebRequest::Create(WWW_Ftp));
infoFiles->Credentials=gcnew NetworkCredential(text_Credential1,text_Credential2);
infoFiles->Method=WebRequestMethods::Ftp::DownloadFile;
date=dynamic_cast<FtpWebResponse^>(infoFiles->GetResponse());
Str=date->GetResponseStream();
download_File=gcnew FileStream("./"+textBox2->Text,FileMode::Create);
do
{
size_Files=Str->Read(size_Byte,0,size_Byte->Length);
download_File->Write(size_Byte,0,size_Files);
}while(size_Files!=0);
download_File->Flush();
download_File->Close();
date->Close();
Str->Close();


}
private: System::Void listBox1_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
textBox3->Text=listBox1->Text;
}
};
}

czwartek, 9 marca 2017

Graphics^ (continue) Visual C++


#pragma endregion
private: Graphics^ m_panel1;
private: Graphics^ m_panel2;
private: Graphics^ m_panel3;
private: System::Drawing::Color Color1;
private: System::Drawing::Color Color2;
private: System::Drawing::Color Color3;
private: Pen^ Pen1;
private: Pen^ Pen2;
private: Pen^ Pen3;
private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
Close();
}
private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
}
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
m_panel1=panel1->CreateGraphics();
m_panel2=panel2->CreateGraphics();
m_panel3=panel3->CreateGraphics();
Color1=System::Drawing::Color::Blue;
Color2=System::Drawing::Color::Red;
Color3=System::Drawing::Color::Green;
Pen1=gcnew Pen(Color1);
Pen2=gcnew Pen(Color2);
Pen3=gcnew Pen(Color3);
System::Int32 Width;
System::Int32 Height;
Width=panel1->Width;
Height=panel1->Height;
System::Int32 centr_X;
System::Int32 centr_Y;
centr_X=Width/2;
centr_Y=Height/2;
m_panel1->DrawLine(Pen1,0,centr_Y,Width,centr_Y);
m_panel2->DrawLine(Pen2,0,centr_Y,Width,centr_Y);
m_panel3->DrawLine(Pen3,0,centr_Y,Width,centr_Y);
m_panel1->DrawLine(Pen1,centr_X,0,centr_X,Height);
m_panel2->DrawLine(Pen2,centr_X,0,centr_X,Height);
m_panel3->DrawLine(Pen3,centr_X,0,centr_X,Height);
m_panel1->DrawLine(Pen1,0,0,Width,Height);
m_panel2->DrawLine(Pen2,0,0,Width,Height);
m_panel3->DrawLine(Pen3,0,0,Width,Height);
m_panel1->DrawLine(Pen1,0,Height,Width,0);
m_panel2->DrawLine(Pen2,0,Height,Width,0);
m_panel3->DrawLine(Pen3,0,Height,Width,0);
m_panel1->DrawRectangle(Pen1,centr_X-50,centr_Y-50,100,100);
m_panel2->DrawRectangle(Pen2,centr_X-50,centr_Y-50,100,100);
m_panel3->DrawRectangle(Pen3,centr_X-50,centr_Y-50,100,100);
m_panel1->DrawEllipse(Pen1,centr_X-40,centr_Y-40,80,80);
m_panel2->DrawEllipse(Pen2,centr_X-40,centr_Y-40,80,80);
m_panel3->DrawEllipse(Pen3,centr_X-40,centr_Y-40,80,80);

 
}
};
}


Dynamic title form/window in Visual C++



#pragma endregion
private: Form^ title_Window;
private: Button^ close_Button;
private: Label^ info_Text1;
private: Label^ info_Text2;
private: System::Drawing::Font^ font1;
private: System::Drawing::Font^ font2;

private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
}
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
title_Window=gcnew Form;
title_Window->Width=400;
title_Window->Height=300;
title_Window->Text="About application";
title_Window->BackColor=System::Drawing::Color::Azure;
                 close_Button=gcnew Button;
close_Button->Text="&Close";
close_Button->Width=120;
close_Button->Height=60;
close_Button->Location=Point(title_Window->Width/2-close_Button->Width/2,title_Window->Height/2-close_Button->Height/2);
close_Button->BackColor=System::Drawing::Color::Bisque;
close_Button->Click+=gcnew EventHandler(this, &Form1::close_Button_Click);
font1=gcnew System::Drawing::Font(System::Drawing::FontFamily::GenericSansSerif,14,FontStyle::Underline);
font2=gcnew System::Drawing::Font(System::Drawing::FontFamily::GenericSansSerif,12,FontStyle::Regular);
info_Text1=gcnew Label;
info_Text1->Width=250;
info_Text1->Text="l077.blogspot.com";
info_Text1->Font=font1;
info_Text1->Location=Point(title_Window->Width/5,title_Window->Height/6);
info_Text2=gcnew Label;
info_Text2->Width=250;
info_Text2->Text="lukasz.wierzbicki2@gmail.com";
info_Text2->Font=font2;
info_Text2->BackColor=System::Drawing::Color::Yellow;
info_Text2->Location=Point(title_Window->Width/5,title_Window->Height-100);

title_Window->Controls->Add(close_Button);
title_Window->Controls->Add(info_Text1);
title_Window->Controls->Add(info_Text2);
title_Window->Show();
 
}
private: System::Void close_Button_Click(System::Object^ sender,System::EventArgs^ e)
 {
 ((Form^)((Button^)sender)->Parent)->Close();
 }
};
}