caption at run time

  • Thread starter Thread starter Mihai
  • Start date Start date
M

Mihai

I want to change the controls caption at run time. I will take this captions
from a SQL Server table. I want the form to have this new captions when is
showed. Where I have to put the code ? In the forms load event ?
I saw when the form is loaded in the form load event the control collection
is empty.I don't have any buttons or any other controls. Why ?

Thank you
 
Posting the same question twice will not guarantee you an answer. We
still need more information. VB2003 or VB2005? Webforms or Winforms?

Robin S.
 
Mihai said:
I want to change the controls caption at run time. I will take this
captions
from a SQL Server table. I want the form to have this new captions when is
showed. Where I have to put the code ? In the forms load event ?

For example, but you can also assign the captions in the form's constructor
directly after the call to 'InitializeComponent'.
I saw when the form is loaded in the form load event the control
collection
is empty.

This should not be the case.
I don't have any buttons or any other controls. Why ?

Do the controls show up when the form becomes visible?
 
Posting the same question twice will not guarantee you an answer. We still
need more information. VB2003 or VB2005? Webforms or Winforms?

Robin S.

But gives you for sure an answer from Herfried if another regular tells
that.

Cor
 
Well, come on, tell us how you resolved the problem!

Robin S.
-------------------------------
 
Hi Robin !
When I have th error I tried to put the caption in
Me.Controls.Item(btnName).text = ....
It didn't work and what was strange the count property of the controls
collection show = 1 even I had more controls on the form.Today, (I was more
relaxed) I saw from the first shot on the form I have a split container (
this is a container also) and the split container has 2 panels ( each of
each is a container also ) so I have 3 collection.
So the right code was
declare value as collection
value = me.controls.item(splitcontainername).controls.item(0) ' 0 is for the
first panel
value.controls.item("controlname").text = value from SQL server table

So this is all folks, it works fine !
Cheers !
 
Back
Top