ұ ғ ғ
Ә ұқ
ә ү ұ. C++ Builder қ құ ә ү ү Additional ғ StringGrid ә DrawGrid /4.12-/ қ.
Additional ң StringGrid ә DrawGrid . DrawGrid, StringGrid ғ ғ, ғ, ұқ ө , ң ұқң ә ө .
ө (ғ ә ) Longint ColCount ә RowCount қ қ. Қ ү ң ә 5- ң. ғ ң ө ө , ғ ө 66.
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int I, J, K;
K = 0;
for (I = 0; I < StringGrid1->ColCount; I++)
for (J = 0; J < StringGrid1->RowCount; J++)
StringGrid1->Cells[I][J] = IntToStr(++K);
}
ғң ө ү nt DefaultColWidth қ, ң ө ү DefaultRowHeight қ қ. , ң ө ө ұқң /ғ ң/ ө ө ү :
void __fastcall TForm1::FormCreate(TObject *Sender)
{
if (DrawGrid1->DefaultColWidth > 90)
DrawGrid1->GridLineWidth = 2;
Else
DrawGrid1->GridLineWidth = 1;
}
GridLineWidth қ ұғ ө ұғ қң қңғ ң ү қ. Ә ң ә 1- ң ұ, 3- өң ұқ қң қ ө .
ғ ұ
(5,5) ң ғ ғ ғ өң. 4.12- ө.
4.12-. .
ң қ ө:
ң қ | ә | |
Form1 | Caption | 'StringGrid ' |
Label1 | Caption | ' ' |
Label2 | Caption | ' ' |
StringGrid1 StringGrid2 StringGrid1- ө қ қғ | ColCount | 5 (ғң ) |
RowCount | 5 (ң ) | |
FixedCols | 0 ( қғ ғ ) | |
FixedRows | 0 ( қғ ) | |
DefaultRowHeight | 20 (ң ) | |
DefaultColWidth | 50 (ғң ) | |
Height | 113 ( ғ өұ ң ) | |
Width | 265 ( ғ өұ ң ) | |
Options->goEditing | True (ұққ ә ) | |
Options-> AlwaysShowEditing | True ( қ ұқ ғ ) | |
Options->goTabs | True (Tab ғ (Shift+ab)) | |
PopupMenu | PopupMenu1 | |
MainMenu1 | N1: Caption = '' N3: Caption = '' OnClick = N3Click N2: Caption = '' N4: Caption = '' OnClick = N4Click N5: Caption = '' OnClick = N5Click | |
PopupMenu1 | N6: Caption = '' OnClick = N6Click N7: Caption = '' OnClick = N7Click | |
Button1 | Caption = ' ' OnClick = Button1Click |
ә:
|
|
#include
#pragma hdrstop
#include "Unit1.h"
#include "stdlib.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N3Click(TObject *Sender)
{
Form1->Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N4Click(TObject *Sender)
{
for (int i=0;i<5;i++)
for (int j=0;j<5;j++)
StringGrid1->Cells[i][j]= Int ToStr(i+j-2);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N5Click(TObject *Sender)
{
for (int i=0;i<5;i++)
StringGrid1->Rows[i]->Clear();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N6Click(TObject *Sender)
{
for (int i=0;i<5;i++)
for (int j=0;j<5;j++)
StringGrid1->Cells[i][j]=IntToStr(rand()%100-27);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N7Click(TObject *Sender)
{
for (int i=0;i<5;i++)
StringGrid1->Cols[i]->Clear();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
for (int i=0;i<5;i++)
for (int j=0;j<5;j++)
StringGrid2->Cells[j][i]=StringGrid1->Cells[i][j];
}
//---------------------------------------------------------------------------
Ө ұ
ғ ұқ!
құ қ ү :
òӻ қ қ ө ;
ӻ қ ү ;
ә ң ө қ;
ү ғ қ ғ ң ү ө қ;
Қ құ ғ қғ ә ұ , , ғ, ә, қ , қ ә ң қ ә қ.
|
|
1-
# | |||
| A(5,7) | ң ә ғң ң ң қ ә ң қ. ә ү ғ. | Aij>0 |
| A(N,M) | ң ә ң ң ң қ ә қ.ә ғ ү ғ. | N<=4 M<=5 |
| B(N,N) | ғ ә ө қ ң қ ә . | N<=6 |
| B(N,N) | ң ө қ ң қ ә ң . | N<=4 Bij>0 |
| D(K,K) | ң ұ ғ ң ә ғ ғ. | K<=5 |
2- /ққ /
1. | (4,3) ң -ү ң ө ң . ң ә ң ң қ . ққ өң. |
2. | (4,4) ғ ң ғ 90 қ ұғ ғ өң. |
3. | (7,5) ң ұ ң. |
4. | (5,7) ң ғ ұ ң. |
5. | (10) ү ү ә ұң / ә- , ң ә- , ұ- / |