Window Height

G

Guest

I have a form with an unbound control that I am using to display a status
message similar to:
Step 1 complete
Step 2 complete
etc.

As each message line is added, I have the control expanding in height to
accomodate. However, I am running into a problem with the window the form is
in. The window is not expanding, even though I have the AutoResize property
on the form set to Yes, which I thought would expand the window as well.

I tried a statement like:
Forms.Item("StatusForm").WindowHeight = [some value]
but I get an error that says that property is read-only, even though the VB
Help says it is read/write for a form.

Can someone tell me what I am doing wrong? Or is my approach to this off
somewhere?

Thanks.
 
G

Guest

I am not real sure off hand how to fix the expressed problem, but I had a
thought you may want to consider. Unless the number of rows added is limited
you could quickly run out of room.

I am not sure what type of control your using, but a scroll bar would allow
you to see all added rows without causing you to expand beyond the limits of
the size of your screen.

If the number of rows added is limited just make the form and contained
control large enough to accomidate.

Kevin

Just a thought!
 
G

Guest

Thanks for the suggestion.

I modified my form to use a scrollable text control and that does seem to
work better than what I was doing.

Do you know if it is possible to scroll the control so that the last lines
are displayed rather than the first lines. Essentially, this would scroll
the lines off the top. As it stands, you need to scroll manually to see the
last lines.

Thanks.


Kevin said:
I am not real sure off hand how to fix the expressed problem, but I had a
thought you may want to consider. Unless the number of rows added is limited
you could quickly run out of room.

I am not sure what type of control your using, but a scroll bar would allow
you to see all added rows without causing you to expand beyond the limits of
the size of your screen.

If the number of rows added is limited just make the form and contained
control large enough to accomidate.

Kevin

Just a thought!
Martin said:
I have a form with an unbound control that I am using to display a status
message similar to:
Step 1 complete
Step 2 complete
etc.

As each message line is added, I have the control expanding in height to
accomodate. However, I am running into a problem with the window the form is
in. The window is not expanding, even though I have the AutoResize property
on the form set to Yes, which I thought would expand the window as well.

I tried a statement like:
Forms.Item("StatusForm").WindowHeight = [some value]
but I get an error that says that property is read-only, even though the VB
Help says it is read/write for a form.

Can someone tell me what I am doing wrong? Or is my approach to this off
somewhere?

Thanks.
 
G

Guest

I believe you can. I am trying to retrevie an oooold memory! Uuuuugggh! I
think there is a way to either sort the contents of the field or to force it
to display the last record entered, but my mind is in a bit of a fog right
now and I am not sure off hand how! I would also think it would depend on
which control you used. I will try to consider the problem tomorrow and
answer back again. If anyone else has any ideas, please chime in.

Martin said:
Thanks for the suggestion.

I modified my form to use a scrollable text control and that does seem to
work better than what I was doing.

Do you know if it is possible to scroll the control so that the last lines
are displayed rather than the first lines. Essentially, this would scroll
the lines off the top. As it stands, you need to scroll manually to see the
last lines.

Thanks.


Kevin said:
I am not real sure off hand how to fix the expressed problem, but I had a
thought you may want to consider. Unless the number of rows added is limited
you could quickly run out of room.

I am not sure what type of control your using, but a scroll bar would allow
you to see all added rows without causing you to expand beyond the limits of
the size of your screen.

If the number of rows added is limited just make the form and contained
control large enough to accomidate.

Kevin

Just a thought!
Martin said:
I have a form with an unbound control that I am using to display a status
message similar to:
Step 1 complete
Step 2 complete
etc.

As each message line is added, I have the control expanding in height to
accomodate. However, I am running into a problem with the window the form is
in. The window is not expanding, even though I have the AutoResize property
on the form set to Yes, which I thought would expand the window as well.

I tried a statement like:
Forms.Item("StatusForm").WindowHeight = [some value]
but I get an error that says that property is read-only, even though the VB
Help says it is read/write for a form.

Can someone tell me what I am doing wrong? Or is my approach to this off
somewhere?

Thanks.
 
M

Marshall Barton

Martin said:
I have a form with an unbound control that I am using to display a status
message similar to:
Step 1 complete
Step 2 complete
etc.

As each message line is added, I have the control expanding in height to
accomodate. However, I am running into a problem with the window the form is
in. The window is not expanding, even though I have the AutoResize property
on the form set to Yes, which I thought would expand the window as well.

I tried a statement like:
Forms.Item("StatusForm").WindowHeight = [some value]
but I get an error that says that property is read-only, even though the VB
Help says it is read/write for a form.

Can someone tell me what I am doing wrong? Or is my approach to this off
somewhere?


Use a text box for this. You can add a message to the end
by concatenating another line:
Me.textbox = Me.textbox & vbCrLf & "Step x complete"
Then to force the last line to be visible:
Me.textbox.SelStart = Len(Me.textbox)

Don't forget that the text box will always display its
unscrolled contents when it loses the focus.
 
G

Guest

Thank you. That was exactly what I was looking for.


Marshall Barton said:
Martin said:
I have a form with an unbound control that I am using to display a status
message similar to:
Step 1 complete
Step 2 complete
etc.

As each message line is added, I have the control expanding in height to
accomodate. However, I am running into a problem with the window the form is
in. The window is not expanding, even though I have the AutoResize property
on the form set to Yes, which I thought would expand the window as well.

I tried a statement like:
Forms.Item("StatusForm").WindowHeight = [some value]
but I get an error that says that property is read-only, even though the VB
Help says it is read/write for a form.

Can someone tell me what I am doing wrong? Or is my approach to this off
somewhere?


Use a text box for this. You can add a message to the end
by concatenating another line:
Me.textbox = Me.textbox & vbCrLf & "Step x complete"
Then to force the last line to be visible:
Me.textbox.SelStart = Len(Me.textbox)

Don't forget that the text box will always display its
unscrolled contents when it loses the focus.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top