Can I ask Builder q's here? And if I can...

This is the forum for general discussion.

Moderator: 2ffat

Can I ask Builder q's here? And if I can...

Postby Canderel » Fri Jul 23, 2004 2:29 am

I see this forum is quite new, but if the people who wrote some of these articles are reading this then you'd be able to help me.

http://www.cppbuilderdevjournal.com/articles/issues/0010/More_string_grids.htm

Showed me how to override the OnDraw event. (And thank you very much)

What I'd like to know is, how can I change the allignment of the cell I want to write. Default it seems is left, but I am writing numbers in, so how can I make it right or center alligned?

Canvas->Font doesn't have the allignment property, so if someone could help me with it, I'd be forever grateful.
Canderel
 

Postby Canderel » Fri Jul 23, 2004 2:37 am

I got it...

Sorry for bothering you folks.

Code: Select all
  const int AllignmentFlag = (ARow!=0)&&(ACol==5) ? DT_RIGHT : DT_LEFT;
  // draw the text
  RText.left += 2; RText.top += 2;
  DrawText(SGCanvas->Handle,
    text.c_str(), text.Length(), &RText,
    AllignmentFlag |DT_VCENTER |DT_SINGLELINE);
Canderel
 

beaten to it.....

Postby Spaggie » Fri Aug 20, 2004 4:16 am

I was just going to say that :wink:
Spaggie
 


Return to General

Who is online

Users browsing this forum: No registered users and 2 guests

cron