VB6 - Dynamically adjust tab width based on Caption length - tabs

I am new to VB6 development (I understand it is pretty outdated. But maintaining legacy code).
My question is - is it possible to dynamically adjust the width of a Tab based on it's Caption length (i.e. dynamically flexing the width of the tab)?
Example: My English text for a tab contains 10 characters, but French equivalent text contains like 15-20 characters. Would it be possible to accommodate text in the tab without having empty spaces on either sides of the text in both English and French?

Right click on the ssTab control and select properties. Under the General tab, select ssStylePropertyPage from the Style: drop down and NOT ssStyleTabbedDialog.
This will automatically adjust the size of the caption of all tabs based on the length of their captions.
The TabMaxWidth property is ignored when this is selected.

Related

How to break lines in Input field via Development tools

I need to perform a full PDF print of a website with a populated questionnaire. It's accessed via Chrome, but some fields contain extensive answers and they are partially cut as they do not fit within the line. The text can be extracted via copying, but it's not fully visible in a print (I'm sorry, I cannot provide a full picture).
To make the full contents visible in the print, I would like to break it into several lines. I heard that it could be done by adding the "word-wrap: break-word" or "overflow-wrap: break-word" properties, bit it appears that it's an Input field and, from what I heard, such fields are not breakable and I would need to change it to Textarea.
However, when I change the field type to Textarea, the contents of the field disappear.
Is there any relatively simple way to somehow make this field breakable and show full text which was previously provided as an input?
textarea does not have a title attribute. That's why the text disapears. Try to insert the text like this: <textarea>Text should be here</textarea>.

ZPL II and dynamic width of graphic box when reverse printing a field

I am quite new to the ZPL II language and have some trouble with writing text in reverse mode with the ^GB and ^FR commands. As far as I understood the ZPL language, when I want to print a text in reverse mode (white over black) I have to first draw a graphic box with the ^GB command and then set the field to be written to in reverse mode with the special ^FR command.
The problem I have is that I would like to fit the graphic box's width to the text's width. With the font I use, the ^A0 font, I couldn't find out the algorithm to calculate the correct width of the graphic box.
Depending on the text, if there are numbers or letters or both, the graphic box's width is not just (number of caracters)*(width of one caracter)...
Here is the code I use :
^XA
^FO64,0,^GB70,20,10^FS
^FO64,0,^FR^A0N,32,37^FD0001^FS
^XZ
When using a mix of numbers and letters the graphic box doesn't fit anymore :
^XA
^FO64,0,^GB70,20,10^FS
^FO64,0,^FR^A0N,32,37^FDAW01^FS
^XZ
I would be very grateful to anyone who could give me the correct approach to my problem .
I do not believe that there is a way to make the graphic box auto size based on the actual length of the text. I'd recommend using a mono-spaced font. That should easily allow you to calculate the width of the box based on the number of characters. Use Zebra Utilities to download a mono-spaced font to he printer.

show the large text to edit like the textarea

Featured on the cover of Business World as one of the ‘Ten Young Guns’ of the Indian marketing communications community (May, 2010)MBA from IIM, Calcutta .. We need a username and password protected client-login area, where they
can view and download files. Pls let me know your recommended placement
for this and the admin controls (add, upload, delete files).
I have this text which is coming from database , When the user click on the update , it will go to the next page show all the values in INPUT TYPE ="TEXT" field . now my problem is when the text is small , its good and easily visible but when the text is larger like the above example , its not visible like the textarea
So the user can see and edit large text but the textarea has not a feature to show the text and my whole editable text in the form
So any body can help me in this
You can make an <input> text field larger by using the size attribute, or specifying a width in CSS, but it will be confined to a single line, so you need to use a <textarea> to edit multiline content.
You can make the textarea larger using the rows and cols attributes: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
You may need some server side logic based on the length of the text to output the correct form element.

How could I recreate this using a table or matrix (Merging cells)

Here I have a manually created table using textboxes inside of a list object:
The problem with this is that if one of the textboxes has too much text only it will grow while the others will remain the same height.
Now the other issue is you can't merge two cells in the same column (vertical merge). Is there a way using a combination of controls that I could replicate what is in the picture such that if the Release Description textbox has too much text in it and it grows the other controls will grow along with it?
Two suggestions:
1) If you want to keep your current workaround, and wish to avoid the growing of your textboxes you can set the CanGrow property to False.
A UI solution for the long text will be using ToolTip: Lets say that your textbox can contain only 60 chars, in the textbox expression use the following:
=iif(Len(Fields!YourField.Value)>60, Left(Fields!YourField.Value,57) + "...",Fields!YourField.Value)
means that only 57 charecters will be displayed in the text box, the full text should be display will hovering the textbox (using tooltip).
2) If you want to merge cells vertically you can do some workarounds.
You can place a table inside another table's cell, that way using several tables you can perform your desired output.
Attaching sample of using table within another table (I use 3 tables):

SSRS 2008 and Dynamic Positioning of Text Boxes

I'm trying to produce a pay check. I will allow the user to setup the position of the items according to their check style.
From my research, it seems that the position of text boxes in SSRS is static and not dynamic. There is no "expression" option for Top/Left. I thought a way to get around this might be to make the text boxes large and overlapping and then set the padding top/left based on expressions to the positions that user has selected. However, it seems that similar to HTML, the text boxes either float around the higher level text boxes or simply drop out of view.
This would be simple if there were a way to tell SSRS not to be concerned with the order of the text boxes and simply display them overlapping, however I don't feel that there is.
Given that, what other options to I have for dynamically positioning text boxes in an SSRS 2008 report? I'm moving right along with this project but I've hit this stumbling block.
SSRS gives you a lot of options for dynamic formatting but Size and Location are fixed. You cannot change this. Overlapping of textboxes does not work in the soft-break renderers like HTML and Excel but does work in hard-break renderers like PDF or TIFF. Have you tried your padding technique and output the report as PDF?
I'm not sure what are going to do in your report, But in similar cases I usually use Space character to position a text. For instance,
IIf(Len(Fields(YourColumn.valu)) > 10, Fields(YourColumn.valu), "    ")
Note that you have to ensure it can implemented in your case or not. I'm not sure that it is helpful but as long as the location and width properties are fix this is the only option
Note 2 : I'm using Unbreakable Space character instead of simple Space so that SSRS render it without any problem