This message contains graphics. If you do not see the graphics: Graphic Version.
 
Dutch Resources, Getting The Most From Numbered Lists

Dutch Resources

Maybe you have read the article in our last newsletter about the resource files. This article explains how to use the TX Text Control with external resource files which contain information strings, error messages and built-in dialog boxes.

This week, we are very happy to present our second resource file, which will be of interest to those customers living in Holland or creating applications in the Dutch language. This week you can download and use - at your free will - the Dutch resource file.

To use this Dutch resource file in Visual Basic, the following property must be set:

TXTextControl1.ResourceFile = ..\TX Text Control\Bin\tx_res31.dll

Please note that that setting the ResourceFile property of a Text Control does not automatically set the appropriate properties of a connected Button Bar or Status Bar to the same values. These properties must be changed independently.

It is important that the resource library for each language has a unique name, as they must be placed in the same directory as the application's executable file.

Top TX Tip: Getting The Most From Numbered Lists

The Top TX Tip this weeks covers a special case in using numbered lists: We are going to be looking at the possibility of restarting the numbering at a certain point, but without using the numbered list dialog box.

It's not too complicated, if you know how to use the properties. So, this week's Tips 'n Tricks will guide you through a sample program that shows you all that.

The sample has two buttons. One to enable or disable lists, like the small button in the toolbar. And one button that makes the current paragraph restart or continue the numbering.

To make the two buttons display the correct text, we must check the settings of the current paragraph everytime the user changes something. So, there is a procedure called "ToggleButtons" that is called when an TX Change event or a MouseUp event is trapped. This should be straightforward.

Now the interesting part. Here is the code that fires when the Start/Stop button is pressed:

Private Sub StartStop_Click() If (TXTextControl1.ListType = txListNone) Then TXTextControl1.ListType = txListNumbered TXTextControl1.NumberingAttribute(txNumberingFormat) = 3 Else TXTextControl1.ListType = txListNone End If TXTextControl1.SetFocus End Sub

If the current paragraph has no list type set then it is turned into a numbered list with Arabic numbers. If there is already a list, it is deleted.

Here is code for the Restart button:

Private Sub Restart_Click() If (Restart.Caption = "Restart") Then TXTextControl1.NumberingAttribute(txNumberingReStart) = 1 bContinue = True Else TXTextControl1.NumberingAttribute(txNumberingContinue) = 1 End If TXTextControl1.ListType = txListNumbered TXTextControl1.NumberingAttribute(txNumberingFormat) = 3 TXTextControl1.SetFocus End Sub

It simply sets the numbering attribute of the current paragraph to txNumberingReStart or txNumberingContinue respectively and sets the ListType again.

If the Restart button was pressed also a boolean variable called bContinue is set to true. It is used in the KeyUp event handler. If a paragraph was set to restart, the next paragraph should have the attribute txNumberingContinue. To automate this, the event handler waits for the next return and then sets this attribute. That's all.


Best regards

The Newsletter Team

Text Control GmbH respects your online time and privacy. We only send this newsletter to TX Text Control customers and people who have signed up to receive it. However, if you would prefer not to receive future issues of the newsletter, you may unsubscribe at any time. If you received this newsletter forwarded from a colleague or friend, you may wish to subscribe directly.

Sent to: N/A.

Imprint | Unsubscribe | Subscribe

© 2019 Text Control GmbH. All Rights Reserved.