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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, I've just read that excelle

Status
Not open for further replies.

steveouthwaite

Programmer
Feb 12, 2003
165
GB
Hi,

I've just read that excellent FAQ about flexgrids, and thought I'd have a go (as you do...)

I've got a problem though...
superimposing a textbox over the clicked cell...(in the click event of the flexgrid)

text1.fontname = flexgrid.fontname
text1.fontsize = flexgrid.fontsize
text1.top = flexgrid.celltop
text1.left = flexgrid.cellleft
text1.width = flexgrid.cellwidth

(all ok so far...)

text1.height = flexgrid.cellheight

it doesnt want to play (the textbox will not resize it's height)

the fontname, fontsize, position and width all change perfectly, but the height will not!

when the program reaches the "text1.height = flexgrid.cellheight" line, the textbox height is 315, and the flexgrid.cellheight is 225
after executing the line, the textbox.height is still 315!!!



Am I missing something here... I am embarased to say that I am totally stumped by this.

Someone put me out of my misery please.....

 
Thanks, I thought that it would be obvious...

Right then, How do I get around this?
The text fits inside the gridcells with no clipping, so I am assuming that the textbox likes an extra bit of a space above and below the text... unfortunately I am constrained by the amount of info that MUST be on screen, so I cannot just make the gridcells taller... reducing the fontsize in the textbox could probably work, but it would look terrible if the text shrunk when being edited...

A solution of sorts...
By putting the textbox in a picture control, and setting the height of that (so that it clips the textbox) it looks ok, and works fine. There must be a more elegant way than this though. If anyone knows how to turn off the minimum height restriction, or has any suggestions, they will be most appreciated

Steve

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top