Move and display textbox in VB6

0

how are you?

I have in Visual Basic 2 checkbox. By selecting any of them below a textbox is enabled to complete with text, and below I have other objects that for the example are irrelevant.

The problem is that both textbox occupy place in my form (Even though they are in disabled). It is possible that when they are not enabled they do not take place, and when they are enabled to move the objects below?

I hope you understood.

Greetings

    
asked by Pepemujica 21.04.2017 в 14:53
source

3 answers

0

You can hide it and move it somewhere where it does not take place. It's simple, it would be something like this

    Dim lugarOriginal = Caja.Location

    AddHandler chkHabilitarCaja.CheckedChanged, Sub()

                                                    If (chkHabilitarCaja.Checked) Then
                                                        Caja.Visible = True
                                                        Caja.Location = lugarOriginal
                                                    Else
                                                        Caja.Visible = False
                                                        Caja.Location = New Point(0, 0)
                                                    End If

                                                End Sub
    
answered by 29.04.2017 / 16:52
source
1

The best thing you can do is to colcoar the object in a Frame , it could be that Checkbox that you are posting requires more interfaces or other related objects. In that case you can place the frame Visible or not. To locate the cotrol (move on the screen) you can work with the properties Top and Left , that way you can move all your objects in the form.

My suggestion is that you create different Frame you can colcoar the properties Apperaence = 0-Flat , BorderStyle = 0 - None , you place inside the checkbox and other related objects and then move the Frame with the properties that I indicated before. I hope my suggestion will help you.

    
answered by 10.11.2018 в 19:00
0

You can make a texbox invisible (being hidden in the form). But in spite of the applied property a space is created that makes it seem that it is not completely hidden.

invisible: TextBox1.visible = False

  

How can I avoid the displacement that this spacing makes in the   form?

    
answered by 29.04.2017 в 06:06