Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am trying to make a crossword puzzle generator

Status
Not open for further replies.

Pyropat

Programmer
May 21, 2001
9
0
0
US
I am using the Create function to make edit boxes during run-time. The following code doesn't work. I want to make an array of edit boxes but it won't do it. How can I do this?

CEdit *MyBox[1] = new CEdit;

MyBox[1]->Create (ES_CENTER | WS_BORDER | ES_READONLY | WS_CHILD | WS_TABSTOP | WS_VISIBLE, CRect(1,1,20,20), this, 1057);

int WordLength = m_Word.GetLength();
for (m_Looper = 1; m_Looper <= WordLength; m_Looper++)
{
Left = Left + 20;
Top = Top + 20;
Right = Right + 20;
Bottom = Bottom + 20;

CEdit *MyBox[m_Looper] = new CEdit;
MyBox[m_Looper]->Create (ES_CENTER | WS_BORDER | ES_READONLY | WS_CHILD | WS_TABSTOP | WS_VISIBLE, CRect(Left,Top,Right,Bottom), this, 1057);

}
UpdateData(FALSE);
 
I don't really understand what you're trying to do. But below is an example of buttons created at run-time.

In the class definition;
CButton btn[8];

The code;
CRect BtnPosition(20,20,50,50);

for(INT loop=0;loop<8;loop++)
{
btn[loop].Create( CString('1'+loop),WS_VISIBLE,BtnPosition,this,1000+loop );
BtnPosition.left+=40;
BtnPosition.right+=40;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top