Perhaps you could more clearly explain what the issue is.
Spoo
As you can see in the image, the TabCaption is "Configuración de página", and there is enought room to put "Configuración" complete in the first line, and perhaps also the second word "de", but it cuts the word "Configuración" in the middle.
Yeah, I belatedly figured out what your issue might be ..
I can't replicate your issue, but I tried this code frag ..
Code:
With SSTab1
.TabHeight = 400
.TabMaxWidth = 1500
.Tab = 0
.Caption = "configuraciondepagina"
.Tab = 1
.Caption = "configuracion de pagina"
.Tab = 2
.Caption = "configuracion" & vbCrLf & "de pagina"
.Tab = 0
End With
,, and got these results ,,
Unfortunately, in all cases, the text is centered.
As I said, I couldn't replicate your definitely odd situation of
,, left justified top line with weird place to "split" the word
,, centered second line
EDIT:
BTW, my res is 1280 x 1024, Win 10.
Spoo
Last edited by Spooman; Jun 9th, 2017 at 05:38 PM.
Thanks to everybody that took the time to run the sample project.
So far it seems that the issue only happens to me.
I changed to standard fonts and the issue still happens.
I also changed to 96 DPI (100%), removed the Windows theme and set it to classic Windows, but I got the same result:
About changing the font, it only get fixed when the font is small enough to get all the text to fit in a single line (tested with Arial and MS Sans Serif).
What is the TabCtl32.Ocx file version that you have?
Mine is: version 6.1.98.16 of March 24, 2009.
File date time is: 02/16/2010 3:22 PM
File size: 216 KB (221.504 bytes)
What is the TabCtl32.Ocx file version that you have?
Mine is: version 6.1.98.16 of March 24, 2009.
File date time is: 02/16/2010 3:22 PM
File size: 216 KB (221.504 bytes)
Version 6.0.81.69
6/24/1998
SP6 Installed, no Cumulative update installed
Correction:
Version 6.1.97.82
3/8/2004
I was looking on the wrong drive before. The one mentioned at top has no SP installed.
Last edited by DataMiser; Jun 9th, 2017 at 09:01 PM.
Sounds like the cumulative update may be the culprit here.
There have been several warnings related to those updates advising to not install them.
Yes, it seems so.
I know that there were one or more updates that were buggy.
To my understanding, the recomendation was to install just that one after the SP6.
Now I don't remember who said that, probably it was in the microsoft.public.vb.general.discussion newsgroup.
May be I should open a new thread to discuss (and ask) whether to install or not to install that update.
I would say that you should have SP6 installed but not any of the later updates.
The thing is that I've been using it (that update) for several years already, without any issue that I'm aware of (other than this one now), and starting now using just SP6 I'm not sure if that will introduce any bug or change in behavior to the programs that I make newer versions of.
About the SStab issue I "fixed" it changing its Style to property page like.
It is not what I wanted, but now it displays the text correctly (all in one line, whithout wrapping).
I prefer the SSTab.
Reasons:
1) Less code to set up.
2) WYSWYG
3) Order to have the controls at design time.
Cons: no Windows theme.
I have the pending task (may be forever) of to make an SSTab direct replacement able to display with the Windows theme.
Krool is already replacing most of the controls, may be some day he also wants to make the SSTab.
Krools controls have a tabstrip control that uses the common controls tab *and* doesn't have your 3 concerns. The 'windows theme' you cite is more important than you suggest too because of DPI and other issues. SSTab is really not something that should be used these days, especially with Krool's tab control just as easy to use.
Personally, I love the SSTab control, specifically because it's so WYSIWYG. And, for me, it's a fairly bullet-proof control. As can be seen in form pics in other threads, I make frequent use of it. I will admit that I try to keep my tab captions short enough to fit on one line, so I haven't really seen the problems that Eduardo is having.
I've thought many times of using a combination of the PictureBox and the TabStrip to make a WYSIWYG tabbed custom control out of them. It doesn't seem terribly difficult. I just have never taken the time to do it.
The only problem I've found with the SSTab control is that it occasionally gets a bit confused about TabStops, especially when you have containers on the different tab-bodies. Here's a little class I always use when I'm using the SSTab control that fixes that problem:
Code:
Option Explicit
'
Dim WithEvents tabCtl As SSTab
Dim frm As Form
Dim TabStops() As Boolean
'
' A primary purpose of this fix is to correctly control the tab stops.
' To make the appearance of tabs, the SSTab control simply moves the controls out of view.
' An artifact of this approach is that the controls are still able to get the focus when the
' user uses the TAB key. The following code corrects this problem by appropriately turning
' on and off the TabStop properties of the controls as the user tabs from one tab to another.
'
' Another problem has to do with ComboBoxes. When changing to a new tab, dropdown comboboxes
' will have their text selected. The combobox will not have the focus, but their text will be
' selected. The primary problem with this is that it right-justifies the text when there is more
' text than will fit in the textbox portion of the combobox, and this is confusing to users.
' This problem is corrected in the following code.
'
Friend Sub SetTabControl(TheTabControl As SSTab, TheForm As Form)
' Call this in the form load event.
Dim ctl As Control
Dim Ptr As Long
'
Set tabCtl = TheTabControl
Set frm = TheForm
'
' Store the true value of the TabStops.
ReDim TabStops(0 To frm.Controls.Count - 1)
' Not all controls have TabStop property, so we must set error trapping.
On Error Resume Next
For Ptr = 0 To frm.Controls.Count - 1
TabStops(Ptr) = frm.Controls(Ptr).TabStop
Next Ptr
On Error GoTo 0
End Sub
Friend Sub SetTabStopsAccordingly()
' Call this in the form activate event.
' After this first call, it will automatically be called when the tabs change.
Dim ctl As Control
Dim ctlTheControlOrContainer As Control
Dim ItsOnTheTabControl As Boolean
Dim Ptr As Long
'
For Ptr = 0 To frm.Controls.Count - 1
Set ctl = frm.Controls(Ptr)
Set ctlTheControlOrContainer = ctl ' The control might be on a container that's on the SSTab, rather than directly on the SSTab.
Do
Select Case True
Case TypeOf ctlTheControlOrContainer.Container Is SSTab
ItsOnTheTabControl = True
Exit Do ' The way out.
Case TypeOf ctlTheControlOrContainer.Container Is Form
ItsOnTheTabControl = False
Exit Do ' The way out.
End Select
Set ctlTheControlOrContainer = ctlTheControlOrContainer.Container ' Must deal with controls nested deeper than the SSTab control.
Loop
If ItsOnTheTabControl Then
' Not all controls have TabStop property, so we must set error trapping.
On Error Resume Next
If ctlTheControlOrContainer.Left >= 0 Then
ctl.TabStop = TabStops(Ptr) ' If it's showing, restore the original TabStop value.
' Must also fix the problem with combo boxes having an internal focus set.
ctl.SelStart = 0
ctl.SelLength = 0
Else
ctl.TabStop = False
End If
On Error GoTo 0
End If
Next Ptr
End Sub
Private Sub tabCtl_Click(PreviousTab As Integer)
SetTabStopsAccordingly
End Sub
Private Sub tabCtl_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
' This allows other controls to close up when user click off.
' The problem is that clicking into the body of the tab control does NOT cause change in focus.
' The control with the focus keeps it, and it may not close up as typically happens when clicking on dead space of a form.
' You may also want to consider placing this "SetFocus" code on the labels on the tabs. This is NOT automatically done
' because the programmer may want to use a label click for other purposes.
tabCtl.SetFocus
End Sub
I've also got code worked out that allows you to dynamically (during runtime) change the tab that any particular control is on. It's in the codebank.
All The Best,
Elroy
EDIT1: If you intend to use the above class, the easiest way is to throw that code into a CLS module, then declare that module as something like this (Dim oSSTabFix As New Class1), and then call it as instructed in the comments. It should self-destroy when your form closes it's Code/COM object.
EDIT2: Very quickly, here's how I use it. Let's say the above class is named "clsFixTabCtl". In that case, I'd have the following line at module level in any form that had SSTab:
Code:
Dim oFixTabControl As New clsFixTabCtl
And then in Form_Load, I'd have:
Code:
oFixTabControl.SetTabControl tabSomeSSTabControl, Me
And then in Form_Activate, I'd have:
Code:
oFixTabControl.SetTabStopsAccordingly
And that's it. After that, the SSTab control works perfectly.
Last edited by Elroy; Jun 16th, 2017 at 08:23 AM.
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
Don't use PictureBox with TabStrip, create UserControls as panels.
The bonus is that you pull tons of logic out of the client Form into separate modules. This reduces the rat's nest and makes your programs far easier to maintain.
SSTab is a refugee from VB 3 and 640x480 monitors.
Krools controls have a tabstrip control that uses the common controls tab *and* doesn't have your 3 concerns.
I don't know about Krool's tabstrip control, but AFAIK he makes direct replacemente of the controls, so his tabstrip I presume would work in the same way of the original, having the same issues.
I don't have time now to take a look, I'll do it in some other time.
Originally Posted by fafalone
The 'windows theme' you cite is more important than you suggest too because of DPI and other issues.
The windows theme has nothing to do with DPI but with the look, also AFAIK.
The original SStab doesn't have issues with DPI settings that I can remember.
Originally Posted by fafalone
SSTab is really not something that should be used these days, especially with Krool's tab control just as easy to use.
Other than it doesn't support the Windows theme, that I don't think it is so important as you do, I don't see many issues.
It doesn't look bad, changing the fonts from MS Sans Serif to a TrueType like Arial or Microsoft Sans Serif, that is what I do for the whole program.
On the other side, just applying the Windows theme, the tabs controls doesn't look much more modern either.
I recently tried to check how I could do the SSTab replacement, and I found a problem:
The SStab, for being as it is, it must be possible to click in the tabs at design time.
So it means that the control must run at design time.
To run an UserControl at design time, there is a property EditAtDesignTime that must be set to True.
But, even with that, for the control to run at design time, the developer needs to right click on the control and select "Edit" from the context menu, something not desirable at all.
I didn't find a way to overcome that.
It may not be possible to write a direct replacement of the SSTab in VB6.
Edit:
I didn't find a way to force this editing mode.
Last edited by Eduardo-; Jun 15th, 2017 at 12:38 AM.
Man, that IS weird .. boo
And it is not what I encountered when I used vbCrLF on Tab 2 in my post #7.
What happens if you increase .TabHeight?
Also, what happens if you just use "standard" letters .. ie, no accents, no cidellas
(I'm not sure of the terminology, but I guess that it is "language" related and has
to do with specifying UniCodes).
Spoo
Last edited by Spooman; Jun 15th, 2017 at 02:21 AM.
How about the "language" issue?
Could you post the code frag that enables that .. I've never done that before.
EDIT ..
Doing a little bit of checking up on Help, I see that this may be referred to
as double-byte character set (DBCS), as opposed to ANSI.
Actually, I wonder if that is why you are getting 2 squares.
I found this info in Help .. don't know if it is germane ..
Processing Files That Use Double-Byte Characters
In locales where DBCS is used, a file may include both double-byte and single-byte characters. Because a DBCS character is represented by two bytes, your Visual Basic code must avoid splitting it. In the following example, assume Testfile is a text file containing DBCS characters.
,,,
When you use a String variable with Input or InputB to read bytes from a binary file, Unicode conversion occurs and the result is incorrect.
Spoo
Last edited by Spooman; Jun 15th, 2017 at 02:50 AM.
in my last post I made a sample with Tabstrip an Frames. I isn't that much work to set the Tabstrip up
Code:
Private Sub Form_Load()
Dim i As Long
Dim x As Single
Dim y As Single
With TabStrip1
.Width = 8000
.Height = 6500
.Top = 1150
.MultiRow = True
.Left = (Me.ScaleWidth - .Width) / 2
'sort the Frames to Tabstrip
For i = 0 To Frame1.UBound
Frame1(i).Height = 6000
Frame1(i).Width = 7500
Frame1(i).Left = .Left + (.Width - Frame1(i).Width) / 2
Frame1(i).Top = .Top + 210 + (.Height - 210 - Frame1(i).Height) / 2
Frame1(i).Visible = False
Frame1(i).BorderStyle = 1
Next
End With
For i = 0 To Label1placeholder.UBound
Label1placeholder(i).Visible = False
Next
' show 1. Frame
Frame1(0).Visible = True
End Sub
Private Sub TabStrip1_Click()
Dim i As Long
For i = 1 To Frame1.UBound
Frame1(i).Visible = False
Next
i = TabStrip1.SelectedItem.Index
Frame1(i - 1).Visible = True
If i = 2 Then
MsgBox "you clicked Tab2"
Else
' cmdFotoshow.Visible = False
End If
End Sub
I wonder how does people do at design time with TabStrip in cases, for example:
A form that is almost the size of your current developing screen.
You have a TabStrip of, let's say 6 tabs, but may be less that occupies almost all form's size.
How do you manage to place all those Frames or PictureBoxes that are containers of each tab of the TabStrip on the form?
Don't tell me that you use a SStab to store them, just for the design time... LOL
Last edited by Eduardo-; Jun 15th, 2017 at 04:29 PM.
This thread is encouraging me to write a real SSTab replacement.
I think the problem that I outlined in the message #28 could be solved with subclassing.
Update February 2018: For anyone reading this thead, here is the replacement.
Last edited by Eduardo-; Feb 6th, 2018 at 08:02 AM.