This issue has been moved from a ticket on Developer Community.
He detectado el siguiente funcionamiento anómalo:
Tengo una pantalla con varios controles, entre ellos un TabControl y un DataGridview. Enmedio de los dos hay dos Labels.
Al cargar la pantalla, esos dos Labels que tienen sus propiedades Autosize=TRUE y Anchor=Bottom,Left, se colocan en una posición no correcta, que debería ser entre el DataGridView y el TabControl.
He visto que si cambio la propiedad Autosize a FALSE, ese mal comportamiento se arregla.
Translation from Bing:
I have detected the following abnormal operation:
I have a screen with several controls, including a TabControl and a DataGridview. In the middle of the two there are two Labels.
When loading the screen, those two Labels that have their Autosize-TRUE and Anchor-Bottom,Left properties are placed in an unsweeered position, which should be between the DataGridView and the TabControl.
I've seen that if I change the Autosize property to FALSE, that bad behavior is fixed.
Original Comments
Visual Studio Feedback System on 6/10/2020, 00:02 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
John Qiao [MSFT] on 6/10/2020, 02:27 PM:
Hi Maria,
Thanks for your feedback.
If you can reproduce this issue in a new simple project, please share your sample project here, we will test and check this scenario using your sample project on our side, that can help us provide the better response to you.
maria.garbero on 6/10/2020, 03:38 PM:
(private comment, text removed)
John Qiao [MSFT] on 6/10/2020, 05:28 PM:
(private comment, text removed)
maria.garbero on 6/10/2020, 05:36 PM:
Sorry, but I need to change cbAño.SelectedIndex on Form_Load because I need that when I show form, DataGrid already has rows.
If I use Form Shown events, user can be how datagrid is filled.
I don't understand why it fails when autosize is True... Because height is the same, only width changes on text fills.
I think that is a bug of Visual Studio WinForms.
John Qiao [MSFT] on 6/11/2020, 02:15 PM:
(private comment, text removed)
maria.garbero on 6/11/2020, 02:23 PM:
Sorry but I can't remove RellenaFicha from RecuperaPagos because I use it on another part of code (I only sent you a part of code of a complex form).
If you disable Autosize property of labels, the problem has resolved.
I think that is a bug of Visual Studio. Could you report to support developer team? Thanks.
John Qiao [MSFT] on 6/11/2020, 04:12 PM:
Hi Maria,
Thanks for your reply.
So, could you use below codes to showing the fPago form? That will resolve the label display issue.
Private Sub fMDI_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim fPago As New fPagos
'fPago = New fPagos With {
' .MdiParent = Me,
' .Dock = DockStyle.Fill
'}
fPago.TopLevel = False
fPago.Parent = Me
fPago.Dock = DockStyle.Fill
fPago.Show()
fPago.Select()
End Sub
maria.garbero on 6/11/2020, 04:51 PM:
Sorry, but your code is not valid because parent is a MDIForm.
John Qiao [MSFT] on 6/11/2020, 05:08 PM:
(private comment, text removed)
Original Solutions
maria.garbero solved on 6/11/2020, 05:15 PM, 0 votes:
Sorry, but I have problems with upper panel that I have in the original app.
I attach new project edited.
errorlabelautosize.zip
This issue has been moved from a ticket on Developer Community.
He detectado el siguiente funcionamiento anómalo:
Tengo una pantalla con varios controles, entre ellos un TabControl y un DataGridview. Enmedio de los dos hay dos Labels.
Al cargar la pantalla, esos dos Labels que tienen sus propiedades Autosize=TRUE y Anchor=Bottom,Left, se colocan en una posición no correcta, que debería ser entre el DataGridView y el TabControl.
He visto que si cambio la propiedad Autosize a FALSE, ese mal comportamiento se arregla.
Translation from Bing:
I have detected the following abnormal operation:
I have a screen with several controls, including a TabControl and a DataGridview. In the middle of the two there are two Labels.
When loading the screen, those two Labels that have their Autosize-TRUE and Anchor-Bottom,Left properties are placed in an unsweeered position, which should be between the DataGridView and the TabControl.
I've seen that if I change the Autosize property to FALSE, that bad behavior is fixed.
Original Comments
Visual Studio Feedback System on 6/10/2020, 00:02 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
John Qiao [MSFT] on 6/10/2020, 02:27 PM:
Hi Maria,
Thanks for your feedback.
If you can reproduce this issue in a new simple project, please share your sample project here, we will test and check this scenario using your sample project on our side, that can help us provide the better response to you.
maria.garbero on 6/10/2020, 03:38 PM:
(private comment, text removed)
John Qiao [MSFT] on 6/10/2020, 05:28 PM:
(private comment, text removed)
maria.garbero on 6/10/2020, 05:36 PM:
Sorry, but I need to change cbAño.SelectedIndex on Form_Load because I need that when I show form, DataGrid already has rows.
If I use Form Shown events, user can be how datagrid is filled.
I don't understand why it fails when autosize is True... Because height is the same, only width changes on text fills.
I think that is a bug of Visual Studio WinForms.
John Qiao [MSFT] on 6/11/2020, 02:15 PM:
(private comment, text removed)
maria.garbero on 6/11/2020, 02:23 PM:
Sorry but I can't remove RellenaFicha from RecuperaPagos because I use it on another part of code (I only sent you a part of code of a complex form).
If you disable Autosize property of labels, the problem has resolved.
I think that is a bug of Visual Studio. Could you report to support developer team? Thanks.
John Qiao [MSFT] on 6/11/2020, 04:12 PM:
Hi Maria,
Thanks for your reply.
So, could you use below codes to showing the fPago form? That will resolve the label display issue.
Private Sub fMDI_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim fPago As New fPagos 'fPago = New fPagos With { ' .MdiParent = Me, ' .Dock = DockStyle.Fill '} fPago.TopLevel = False fPago.Parent = Me fPago.Dock = DockStyle.Fill fPago.Show() fPago.Select() End Sub
maria.garbero on 6/11/2020, 04:51 PM:
Sorry, but your code is not valid because parent is a MDIForm.
John Qiao [MSFT] on 6/11/2020, 05:08 PM:
(private comment, text removed)
Original Solutions
maria.garbero solved on 6/11/2020, 05:15 PM, 0 votes:
Sorry, but I have problems with upper panel that I have in the original app.
I attach new project edited.
errorlabelautosize.zip