Newsgroup: it.comp.appl.access
Titolo: ocx rtf2 problema dimensione campo

Salve a tutti. Ho un problema per me impossibile da risolvere.(una settimana 
di prove giorno e notte)
Ho installato un controllo OCX rtf 1.0 per l'editor di testi.
Il controllo funziona benissimo per quanto concerne l'editing ma ho un 
problema sul report. Nel report il campo memo non supporta più di un certo 
numero di righe. Infatti se il testo contenuto è superiore a due pagine 
(circa) sul report ne appare solo un riga.
Riporto il codice del report su sull'evento su formattazione.
Private Sub Detail1_Format(Cancel As Integer, FormatCount As Integer)
Dim Height As Integer
    Height = Me.RTFcontrol.Object.RTFheight
      If Height > 0 Then
        If Height < 32000 Then
            Me.RTFcontrol.Height = Height
        End If
    End If
    Me.Section(acDetail).Height = Me.RTFcontrol.Height + Me.RTFcontrol.Top
    If Me.RTFcontrol.Object.RTFheight > 0 Then
        If Me.RTFcontrol.Object.RTFheight < 32000 Then
            Me.RTFcontrol.Height = Me.RTFcontrol.Object.RTFheight
        End If
    End If
End Sub
Grazie per l'attenzione. (spero) 


Mi pare leggermente differente da quanto Stephen indica nel suo
sito....!
Inizia con usare correttamente quanto lui ha suggerito.
http://www.lebans.com/richtext.htm
Here is code to support resizing of multiple RTF2 control in the same
Detail section. The example assumes two RTF2 controls named
"RTFControl" and "RTFControl2".
@Alex

 ha scritto nel messaggio 
news:2cfb506b-8ab2-4a2f...@26g2000hsk.googlegroups.com...


 R.
Se leggi bene:
' Now set the Detail Section's Height to the Maximum calculated value.
Me.Section(acDetail).Height = MaxHeight
Questo significa che deve essere l'ultima cosa da fare... mentre tu
non la fai per ultimo... oltretutto la 2° parte dovrebbe essere usata
solo in caso tu abbia 2 Controlli, in modo da adattare ol 2° al
primo... ma tu ne hai solo uno o sbaglio..??
Updated - May 23, 2004                                            This
Page Viewed: times.
Here's the next release, Version 2.0. I'll leave it in Beta until I
hear from people that everything is working properly. Lots of new
properties!. (Coming soon!)
I need your Help! In an effort to finally build a proper Help file I
am looking for code samples using the props and methods of the RTF2
control. I am also looking for a more finished Access RTF2 TooolBar
then the one I included in the original sample RTF2 MDB's. Please
Email your suggestions and I will add them to the Help file I have
started compiling.
Production Release RTF2 1.8 May 23, 2004 RichText ActiveX
Version 1.8
Fixed Default Font and BackColor props. Added Selxx props for Bold,
Italic, UnderLine, FontName, and FontSize. Added Plaintext property.
Fixed Backspace bug from version 1.7
Here is the full installation package of the RTF2 Active control,
version 1.8: RichTextActiveXonlyVersion1.8.zip
RTF2 control is an ActiveX RTF solution written in VC++. The RTF2
control is a complete editing/printing solution for Access 97 or
higher. Autosizing of the RTF2 control is supported for A2K or higher.
This is a full automatic install package. This install package
contains 3 required files for the control to function. The OCX itself,
RTF2.OCX and the 2 VC runtime files, Mfc42.Dll and Msvcrt.Dll. AFAIK
the two VC runtime files will already exist on all installs of
Windows.
Bug Fix for A2K and A97 sample MDB's. There was some corruption in the
sample Form itself. I have imported everything into a fresh MDB and
the Form's corruption seems to be fixed. Please let me know if you see
any more problems with the A2K or A97 Sample MDB's.
Here are some sample MDB's to demonstrate the control's functionality.
A2KRTF2Sample.zip and A97RTF2Sample.zip You must install the RTF2
ActiveX control before opening either of these sample MDB's. If you
have ActiveX registration problems and you end up reinserting the RTF2
ActiveX control onto the sample Forms/Reports make sure you rename the
control to "RTFControl" in order for the sample autosizing code to
work properly. Both sample MDB's contain a ToolBar named RTF2.
Remember to import this ToolBar into any MDB containing the RTF2
ActiveX control. Please note that the Toolbars are  no longer needed
for RTF2 Versions 1.4 and higher as they have a built in context/
editing Menu.
Here is a sample MDB from Andre Minhorst from Germany. It demonstrates
how to break up an RTF document into separate paragraphs. AndreRTF.zip
The RTF2 ActiveX control requires a minimum of Version 3 of the Rich
Edit DLL found on Windows 2K or higher installs. The control will work
with earlier versions but you will lose advanced functionality, such
as full text justification. You can get Version 3 for earlier versions
of windows automatically installed by downloading the Windows
Installer program from Microsoft found here:
Windows Installer 2.0 Redistributable for Windows 95, 98, and Me:
http://www.microsoft.com/downloads/details.aspx?FamilyID=cebbacd8-c094-4255-b702-de3bb768148f&DisplayLang=en
Bugs/Workarounds for the RTF2 control
Where is the Help File?
Click here for sample code to resize the control simulating CanGrow/
Shrink
Where is the Intellisense for the RTF2 control in the VB IDE?
How do I access the RTF2 control's Change event?
How do I set the Default Font for the control?
Click here for Keyboard Shortcuts
Click here for Bugs/Workarounds
Workaround for the Enabled and Locked properties for the RTF2 Control
Where is the Version information?
Click here for the older non-ActiveX RTF solutions:
How can I copy the contents of the RTF2 control to MS Word?
How do I access the RTF2 control's Change event?
With the VB IDE window object click on the down array for the Object
dropdown control. Scroll down and select the RTF2 control. The name
appearing in the drop down  list window will be whatever you named
your control on the form. Now to the very right of this window is the
Procedure drop down control. Again click on the down arrow and a list
of the supported events will appear. Select the Change event. Code
will be added automatically to your form's class module that you can
then add to/modify to derive the desired functionality.
Where is the Intellisense for the RTF2 control
Declare an object of type RTF2 in your Form's Load event. For this
example we will use the name "rtf" for our object.
Dim rtf As RTF2
In the Form's Load Event, assign our object to an instance of the RTF2
control. Here we assume we have an RTF2 control on our form named
"RTFcontrol"
Set rtf = Me.RTFcontrol.Object
Now whenever you reference the rtf object Intellisense will be
available.
Here is code to support resizing of multiple RTF2 control in the same
Detail section. The example assumes two RTF2 controls named
"RTFControl" and "RTFControl2".
Il tuo codice dovrebbe essere questo:
Private Sub Detail1_Format(Cancel As Integer, FormatCount As Integer)
    ' Height of the current RTF2 Control
    Dim Height As Integer
    ' Max height to allow for multiple RTF2 controls
    Dim MaxHeight As Integer
    ' Init MaxHeight
    MaxHeight = 0
    Height = Me.RTFcontrol.Object.RTFheight
    If Height > 0 Then
        If Height < 32000 Then
            Me.RTFcontrol.Height = Height
            If MaxHeight > Me.RTFcontrol.Height + Me.RTFcontrol.Top
Then _
                    MaxHeight = Me.RTFcontrol.Height +
Me.RTFcontrol.Top
        End If
     End If
' Now set the Detail Section's Height to the Maximum calculated value.
Me.Section(acDetail).Height = MaxHeight
End Sub
Ora fai attenzione alla sezione in cui hai messo il controllo RTF...
Se effettivamente hai ancora problemi scrivi direttamente a Stephen
potrebbe essere un Baco, ma fai bene attenzione ad effettuare i
controlli in modo completo.
@Alex

 ha scritto nel messaggio 
news:691ed1f9-569e-41c8...@d77g2000hsb.googlegroups.com...
