question about the stephan lebans rtf2 control

  • Thread starter kelly d via AccessMonster.com
  • Start date
K

kelly d via AccessMonster.com

couple questions actually.
i'm using 42 1" x 1" RTF2 controls on a calendar app i've developed.
i've imported the RTF2 toolbar and module into my project and have registered
the RTF2.ocx

1. the center alignment no longer works. clicking center right justifies the
text in the control. I havnt changed the cbCenter_Click code at all from it's
original state. it just doesnt work now. if anybody knows why or what to do
to fix that, It would be appreciated.

2. how do I get the .SelAlignment value of the RTF2 control cuz when I do a
debug.print ctlX.SelAlignment, I either get an error that it's not supported
or I get nothing at all.

3. how do I change the text background color back to transparent cuz when I
change the background color to something and then back to white, when I
change the background color of the RTF2 control, the text background color I
changed earlier is still white and not the color I changed the box background
to.

If the things I'm trying to do with the RTF2 control arn't doable at this
time with the RTF2 control then maybe somebody might be able to answer a
question about the regular RTF control.
I have another version of this calendar app with just RTF controls on it. it
works great everything I want it to do.
problem is when I change the background color of an RTF control, It looks
just fine on screen with the color I chose, but when I go to print it (I'm
printing a form by the way, cuz RTF's dont work on reports) the way it prints
is where ever I've typed text, that entire line prints white and only lines
that I havnt typed on actually print the color I changed the background to.
obviously a bug, but maybe somebody knows a fix for it. (AC2002, WinXP)

thanks
Kelly D.
 
K

kelly d via AccessMonster.com

I just got the RTF2 version of my calendar to a workable point so I did a
printout of it, no background color at all. not even messed up color like my
RTF version had. I dont suppose anybody might have an opinion on how to fix
that one do they.

thanks
Kelly D.
 
S

Stephen Lebans

Does the Center Justification still fail iff you forget about the Toolbar
and use the built in right click Context Menu?

I see from a later post that you resolved your backcolor issue. I would
remind you that this control was built for display ONLY on forms. To print
you should always build a report to support the form.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
K

kelly d via AccessMonster.com

the 'align center' does work properly in the right-click menu, which is
something I never thought to check, so it seems to be a toolbar problem,
which i guess means it's a 'ctlX.SelAlignment = CLng(rtfCenter)' problem?

so then just simply putting the RTF2 control in a report instead of printing
a form with .PrintOut will fix my color problem? I will definitely try that.
 
K

kelly d via AccessMonster.com

ok. tested the report thing. it still doesnt show any background color in a
report either.
 
S

Stephen Lebans

Place a breakpoint at the line of code you posted.
Check the value of rtfCenter
Now open the Object Browser window.
Select the RTF2Lib only
Click on enumRTFAlignment
The value for rtfCenter is 3.

Does this match the value of rtfCenter at your breakpoint?

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
K

kelly d via AccessMonster.com

in the object library, the rtfCenter constant had a value of 3 but when I put
a breakpoint in the code and looked at the value of rtfCenter in the code it
was coming up 2. I replaced rtfCenter with a 3 and now the center align works
fine on the toolbar. why would the code just change the value of the
constant like that if that constant hasn't been redefined elsewhere in the
code (which I havn't done)
 
K

kelly d via AccessMonster.com

it would appear as though the rtf2 alignment constants where conflicting with
the alignment constants of the same name in the richtext library and the
richtext library won. (cuz i noticed the same prob with align left, right and
justify too so i changed them from the constant name to the actual number)
 
S

Stephen Lebans

I used the same Constant names because I never envisioned a situation where
an MDB would contain a reference to both the MS RTF and my RTF2 control.
You just need to disambiguate(seperate out) the references. Preface the RTF2
constants with RTF2Lib.rtfCenter etc.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
K

kelly d via AccessMonster.com

Fair enough solution. thank you.
As far as not being able to print the background color. have you ever run
into that issue. I dont suppose you know of a solution for it do you cuz I'm
not sure which of my previous posts that I made sound like I had corrected
the problem (probably just me not wording myself correctly) but I havn't
figured out a fix for it yet.
I was looking at some VB code that captures an image of a form in a picture
control to print out but I havn't implemented it yet nor am I sure if its
even going to work. Plus I read that doing so drastically reduces the print
quality and if thats true then I wont be using this form image capturing
solution anyway.

Thanks
Kelly D.
 
K

kelly d via AccessMonster.com

I dont suppose there is a way to make an RTF2 or an RTF control transparent
is there so that objects underneath them can be seen?
 
S

Stephen Lebans

There is but not reliably in the later versions of Access/Windows so I do
not support this feature.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
S

Stephen Lebans

Kelly you are all over the place with your questions. You need to post clear
concise questions, preferably one at a time.

There is lots of VB code out there to capture a window(form). I have
absolutely no idea what you mean that doing this drastically reduces the
print quality. You can only print what you capture. It comes down to the
current resolution setting of your display versus the output resolution of
your printer. But if final resolution is a concern why don't you simply
print the form or better yet, design a report and print it.

I have not run into the background color issue you describe but I would
remind you again that forms are for viewing and reports are for printing.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
K

kelly d via AccessMonster.com

:) sorry. sometimes my mind goes faster than my fingers when i type.
simplified, the problem I am facing now is I cant print the background colors
of the RTF2 controls.
 
S

Stephen Lebans

Is this the background color for the entire control or the back color of the
Text? It's been several years but I think the background color of the entire
control is for display purposes only.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
K

kelly d via AccessMonster.com

yeah. it is for the background color of the entire control. and I'm
discovering the hard way that it is for display purposes only and wont print.
I'm trying to BitBlt my calendar onto another borderless form for print but
that seems sloppy to me so I was hoping somebody knew of a better way.
 
K

kelly d via AccessMonster.com

Stephen,
searching on this forum, i found a post from about 2 months ago (
http://www.accessmonster.com/Uwe/Fo...984/clipboard-image-to-image-control-via-code
)

where you had responded to somebody asking how to get an image from the
clipboard to an image control. you suggested you had code that would go from
image to clipboard and you thought that going from clipboard to image would
be the same process just in reverse so i tried that. what I tried was where
your code had assigned the image in an image control to a variable, I
assigned the bitmap in the clipboard to that variable using GetClipBoardData
(CF_DIB). And where you had assigned the bitmap data in memory to the
clipboard using SetClipBoardData, I tried to assign that bitmap data to the
image control using ctl.picturedata= hClipMemory
what I get is 'object doesnt support this property or method' and then debugs
to where i called your FPictureDataToClipBoard function using
FPictureDataToClipBoard (forms!test!image3)

I dont suppose you have any code samples that demonstrate how to go from
clipboard to image control do you?

Thanks
Kelly D.
 
K

kelly d via AccessMonster.com

Nevermind. I think I got the whole thing beat.
I found some code on the AccessWeb that showed me how to find the Hwnd of an
Access forms client area so I could get the DC of that Hwnd and that led to
me to be able to BitBlt onto a blank form which I can now do a PrintOut and
voila! a printable screenshot of my calendar complete with RTF2 Controls and
their background colors.
Admittedly the solution aint pretty, but then again, neither was the problem.
Sometimes dirty little problems require dirty little answers.

Thanks
Kelly D.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top