Click here to Skip to main content
15,885,546 members
Articles / Desktop Programming / MFC
Article

gTextbox - similar grid with source code

Rate me:
Please Sign up or sign in to vote.
1.38/5 (26 votes)
20 Aug 20034 min read 100.1K   2.5K   14   20
you can use this control to your program - see sample .

Download sourcecode

Download Demo Project

Introduction

this object (ActiveX control) a best grid .

See Image Please.

Sample screenshot

Introduction:

Exist Grids Programs always include a basic fault .

A Object included many Property & many Methods & many Events.

But in Grid , can’t see a field similar to an Object.

And a Grid don’t includes all “base Objects” (TextBox , CheckBox , RadioButton , CommandButton , ComboBox , ListBox , …)

Sample screenshot

<o:wrapblock><v:shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><v:stroke joinstyle="miter"><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"><v:f eqn="sum @0 1 0"><v:f eqn="sum 0 0 @1"><v:f eqn="prod @2 1 2"><v:f eqn="prod @3 21600 pixelWidth"><v:f eqn="prod @3 21600 pixelHeight"><v:f eqn="sum @0 0 1"><v:f eqn="prod @6 1 2"><v:f eqn="prod @7 21600 pixelWidth"><v:f eqn="sum @8 21600 0"><v:f eqn="prod @7 21600 pixelHeight"><v:f eqn="sum @10 21600 0"><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"><o:lock aspectratio="t" v:ext="edit"><v:shape id="_x0000_s1027" style="MARGIN-TOP: 14.6pt; Z-INDEX: 2; MARGIN-LEFT: 135pt; WIDTH: 227.95pt; POSITION: absolute; HEIGHT: 53.25pt" stroked="t" strokeweight="2.25pt" type="#_x0000_t75"><v:imagedata o:title="" src="file:///D:/DOCUME~1/Ashkan.JEL/LOCALS~1/Temp/msoclip1/01/clip_image001.png"><w:wrap type="topAndBottom">
I always feel  that . 

I feel  , most be create many Objects similar to “base Objects “ ,  included  all Properties and methods and  Events of  basic Objects and can use this instead of  Grid.

Oracle Developer very help me.

2 years ago I works to this method (Group Objects)  and  yet not completed .

Target :

Create many Objects with 4  properties

1-     Single Objects ( Separated with other similar objects )

2-     very simply to link them

3-     included all property and methods and Events of basic Objects.

4-     Can used this similar Grid.(Multi row)

This object (gTextBox):

This Object(after that call gTextBox) is similar to a TextBox (with Maximum compatibility)  but a different , This is a Group TextBox objects instead of single TextBox .

I  named this “gTextBox”.

I am doing create other objects (gCheckBox-gCommandButton-gComboBox and …)

gTextBox included many properties -methods and events for itself and all properties and methods and events of single TextBox .

see this image :

<o:p>Sample screenshot


Any row included all properties and methods and events a TextBox  and included many property and methods and events to itself. <o:p>

Professional Details

ü      gTextBox Properties

Property Name

Description

Access

ChangeForeColor

After Change Text Change forecolor to this

R(rw)

D(rw)

Count

Number of Record is exist

R(r)

GridColor

set and return Grid Color

R(rw)

D(rw)

NumberOnly

set and return gTextBox only Number input (not alphabet)

R(rw)

D(rw)

ParsiWrite

set and return input language (for Persian Language only)

R(rw)

D(rw)

ReadOnly

set and return gTextBox is Read only or not (if Read Only not editable)

R(rw)

D(rw)

Records

Include All Records in gTextBox(is a collection class)

R(rw)

RowBackColor

set and return Current Row Back Color

R(rw)

D(rw)

RowForeColor

set and return Current Row fore Color

 <o:p>

R(rw)

D(rw)

RowShow

set and return Number of row show (default is 10)

R(rw)

D(rw)

RowSize

set and return row size ( Pixel )

R(rw)

D(rw)

ScrollBar

set and return scroll bar exist or not

R(rw)

D(rw)

ScrollWidth

set and return scroll bar width (pixel)

R(rw)

D(rw)

SelectedItem

set and return current item

R(r)

SizableRow

set and return can change row size at runtime

R(rw)

D(rw)

SpaceHorizontal

set and return space between this object with other object

R(rw)

D(rw)

SpaceVertical

set and return space between textboxs in gTextBox

R(rw)

D(rw)

R = access at Runtime

D=access at Designtime

(r)=readable

(w)=writeable <o:p>

ü      gTextBox  Methods

Method Name

Description

Parameters

AddItem

Add a new record to Records

 <o:p>

Text as string

Clear

Clear all records and set Records property to empty

None

GoFocus

Set Focus to a text box (current row)

 <o:p>

MoveRecordTo

Move row to a specified record ( you most say row number [newCursor] and record number [newRecord] )

newCursor as integer

newRecord as long

Refresh

Refresh all records of gTextBox

None

Remove

Remove specified record

DeletedRecordNo as long

RollBack

Roll back specified record

RecordNo as long (if not define roll back all records)

 <o:p>


 

ü      gTextBox Events

Event Name

Description

Parameters

HappenedTime

AfterDelete

After delete a row active this event

None

After delete

AfterInsert

After insert a record active this event

RecordNo as long record number to be inserted

After insert

AfterChange

After change a record (only first time)

CursorNo as integer (row number)

RecordNo as long

After change

BeforeChange

Before change a record (only first time)

CursorNo as integer (row number)

RecordNo as long

Before change

BeforeDelete

Before delete a record (only current record)

You can cancel deleting

Cancel As Boolean

Before delete

BeforeClear

Before clear all record

You can cancel clearing

Cancel As Boolean

Before clear

BeforeInsert

Before insert a record

You can cancel inserting

Cancel As Boolean

Before insert

ChangeRowSize

change row size (if drag grid with mouse)

you can cancel row size change

Cancel As Boolean ChangeSize As Single

On change (drag mouse on grid)

OnMoveRecord

Moving a new record

CursorNo As Integer

RecordNo As Long

After change row number

OnScroll

Scroll and going to new record

CursorNo As Integer

RecordNo As Long

After move to new record only with change scroll bar

Validation

Validation (equal validate Event)

CursorNo As Integer

RecordNo As Long

Cancel As Boolean

Before exit from a row

 <o:p>


 

Revision History(Version)

Version 1.0 <o:p>

  • Last Updates  at 29/Tir/2562(Parsi) equal 20-july-2003

Further program (Coming version)

1- connecting ADO DataBase .

2- add Formula property (very powerfull)

3- and …<o:p>

 <o:p>

 

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United Arab Emirates United Arab Emirates
I am Davood.J live in Tehran from IRAN.
I am married with one child (a boy 5 year old).
my basic work is "system analyst" and "system designer" .
but i like programming .
i work with Visual Basic 6.0 & Microsoft Access 2000 and Oracle Developer and Designer (very little) .

Comments and Discussions

 
QuestionHow do i make this thing work! Pin
_Chosen23-Jul-06 10:13
_Chosen23-Jul-06 10:13 
Generalneed help.. urgent..!!! Pin
suriac10-Jan-04 17:58
suriac10-Jan-04 17:58 
GeneralSource Code Pin
iranvig3-Aug-03 18:17
iranvig3-Aug-03 18:17 
Generalfor other information call me . Pin
Rama Krishna Vavilala31-Jul-03 10:11
Rama Krishna Vavilala31-Jul-03 10:11 
>>for other information call me .
What is your phone number?



I don't choose the targets - they present themselves to me in an almost garish display of submission and sacrifice. It's my duty to react as I do. - John Simmons/Outlaw Programmer
GeneralRe: for other information call me . Pin
iranvig3-Aug-03 18:14
iranvig3-Aug-03 18:14 
GeneralAbout your article Pin
Stanislav Panasik30-Jul-03 18:37
Stanislav Panasik30-Jul-03 18:37 
GeneralRe: About your article Pin
iranvig30-Jul-03 19:27
iranvig30-Jul-03 19:27 
GeneralSorry to all. Pin
iranvig30-Jul-03 17:57
iranvig30-Jul-03 17:57 
GeneralRe: Sorry from all. Pin
dog_spawn31-Jul-03 0:52
dog_spawn31-Jul-03 0:52 
GeneralRe: Sorry from all. Pin
iranvig31-Jul-03 2:13
iranvig31-Jul-03 2:13 
QuestionNew concept? Pin
dog_spawn30-Jul-03 11:16
dog_spawn30-Jul-03 11:16 
AnswerRe: New concept? Pin
iranvig30-Jul-03 19:38
iranvig30-Jul-03 19:38 
GeneralStupid article Pin
chong_lim30-Jul-03 9:42
chong_lim30-Jul-03 9:42 
GeneralRe: Stupid article Pin
John M. Drescher30-Jul-03 10:52
John M. Drescher30-Jul-03 10:52 
GeneralRe: Stupid article Pin
Anonymous1-Aug-03 17:25
Anonymous1-Aug-03 17:25 
GeneralCan't find the file you give us Pin
adamsmin30-Jul-03 8:51
adamsmin30-Jul-03 8:51 
GeneralRe: Can't find the file you give us Pin
iranvig30-Jul-03 18:08
iranvig30-Jul-03 18:08 
GeneralPlease stay home... Pin
Davide Calabro30-Jul-03 8:19
Davide Calabro30-Jul-03 8:19 
GeneralRe: Please stay home... Pin
Dimitris Vasiliadis4-Aug-03 20:28
Dimitris Vasiliadis4-Aug-03 20:28 
GeneralRe: Please stay home... Pin
Davide Calabro4-Aug-03 23:18
Davide Calabro4-Aug-03 23:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.