changing size of textbox to match form
changing size of textbox to match form
am 25.10.2007 12:39:31 von Phil Reynolds
I have a single text box (a large one) in a form that pops up. I want the
text box to change size as the user changes the size of the form. However,
doing me.txtbox.width = me.width doesn't work, as the width value of the
form doesn't seem to change, even as the form is resized by the user.
How can get the textbox to always be the same size as the form that contains
it?
Re: changing size of textbox to match form
am 25.10.2007 14:47:10 von Rick Brandt
Phil Reynolds wrote:
> I have a single text box (a large one) in a form that pops up. I want
> the text box to change size as the user changes the size of the form.
> However, doing me.txtbox.width = me.width doesn't work, as the width
> value of the form doesn't seem to change, even as the form is resized
> by the user.
> How can get the textbox to always be the same size as the form that
> contains it?
First, realize that the user is not resizing the form. They are resizing
the *window* that the form is hosted in and that IS different.
You can use the Resize event of the form (confusing I know), and when the
window is made larger you will first have to make the form section where
the TextBox resides wider and/or taller and then resize the TextBox. If the
form is made smaller you have to first resize the TextBox and then resize
the form section. Doing these in the wrong order will cause an error. You
cannot make the TextBox domensions extend beyond the section and you cannot
make the section so small that it infringes on space already being used by
the TextBox. It gets a bit more complicated because in one move the user
can make the width smaller while making the height greater or vise-versa.
All of these adjustments will be relative to the InsideHeight and
InsideWidth properties of the form.
I do this fairly often so users with higher resolution displays can make a
parent form taller so that they see more rows of a continuous subform than
the default. I also save the size in a table per user so that the form
opens that size the next time.
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Re: changing size of textbox to match form
am 25.10.2007 23:01:47 von Phil Reynolds
Thanks, Rick, that's what I needed.
"Rick Brandt" wrote in message
news:if0Ui.2370$Bk.2078@newssvr19.news.prodigy.net...
> Phil Reynolds wrote:
>> I have a single text box (a large one) in a form that pops up. I want
>> the text box to change size as the user changes the size of the form.
>> However, doing me.txtbox.width = me.width doesn't work, as the width
>> value of the form doesn't seem to change, even as the form is resized
>> by the user.
>> How can get the textbox to always be the same size as the form that
>> contains it?
>
> First, realize that the user is not resizing the form. They are resizing
> the *window* that the form is hosted in and that IS different.
>
> You can use the Resize event of the form (confusing I know), and when the
> window is made larger you will first have to make the form section where
> the TextBox resides wider and/or taller and then resize the TextBox. If
> the form is made smaller you have to first resize the TextBox and then
> resize the form section. Doing these in the wrong order will cause an
> error. You cannot make the TextBox domensions extend beyond the section
> and you cannot make the section so small that it infringes on space
> already being used by the TextBox. It gets a bit more complicated because
> in one move the user can make the width smaller while making the height
> greater or vise-versa.
>
> All of these adjustments will be relative to the InsideHeight and
> InsideWidth properties of the form.
>
> I do this fairly often so users with higher resolution displays can make a
> parent form taller so that they see more rows of a continuous subform than
> the default. I also save the size in a table per user so that the form
> opens that size the next time.
>
> --
> Rick Brandt, Microsoft Access MVP
> Email (as appropriate) to...
> RBrandt at Hunter dot com
>
Re: changing size of textbox to match form
am 04.11.2007 01:45:34 von Phil Reynolds
Hey, Rick. One more question for you. If I want to close and reopen the form
when the user moves to a new record, how can I place the form in the same
position on the screen as it was before it was closed. In other words, the
user has this pop-up form open; they move to a new record; the OnCurrent
event closes the form, then reopens it, using the InsideHeight and
InsideWidth properties to resize the form to how it was before it was
closed. But how put it in the same place on the screen where it was before
it was closed? Thanks.
"Rick Brandt" wrote in message
news:if0Ui.2370$Bk.2078@newssvr19.news.prodigy.net...
> Phil Reynolds wrote:
>> I have a single text box (a large one) in a form that pops up. I want
>> the text box to change size as the user changes the size of the form.
>> However, doing me.txtbox.width = me.width doesn't work, as the width
>> value of the form doesn't seem to change, even as the form is resized
>> by the user.
>> How can get the textbox to always be the same size as the form that
>> contains it?
>
> First, realize that the user is not resizing the form. They are resizing
> the *window* that the form is hosted in and that IS different.
>
> You can use the Resize event of the form (confusing I know), and when the
> window is made larger you will first have to make the form section where
> the TextBox resides wider and/or taller and then resize the TextBox. If
> the form is made smaller you have to first resize the TextBox and then
> resize the form section. Doing these in the wrong order will cause an
> error. You cannot make the TextBox domensions extend beyond the section
> and you cannot make the section so small that it infringes on space
> already being used by the TextBox. It gets a bit more complicated because
> in one move the user can make the width smaller while making the height
> greater or vise-versa.
>
> All of these adjustments will be relative to the InsideHeight and
> InsideWidth properties of the form.
>
> I do this fairly often so users with higher resolution displays can make a
> parent form taller so that they see more rows of a continuous subform than
> the default. I also save the size in a table per user so that the form
> opens that size the next time.
>
> --
> Rick Brandt, Microsoft Access MVP
> Email (as appropriate) to...
> RBrandt at Hunter dot com
>
Re: changing size of textbox to match form
am 05.11.2007 13:07:20 von BruceM
You can use the MoveSize function in the form's Open event. Help has more
information, but in general you would use the Top and Left arguments only,
and leave the Height and Width arguments blank since you have code to take
care of that.
"Phil Reynolds" wrote in message
news:zD8Xi.91$0Q5.38@nlpi070.nbdc.sbc.com...
> Hey, Rick. One more question for you. If I want to close and reopen the
> form when the user moves to a new record, how can I place the form in the
> same position on the screen as it was before it was closed. In other
> words, the user has this pop-up form open; they move to a new record; the
> OnCurrent event closes the form, then reopens it, using the InsideHeight
> and InsideWidth properties to resize the form to how it was before it was
> closed. But how put it in the same place on the screen where it was before
> it was closed? Thanks.
>
> "Rick Brandt" wrote in message
> news:if0Ui.2370$Bk.2078@newssvr19.news.prodigy.net...
>> Phil Reynolds wrote:
>>> I have a single text box (a large one) in a form that pops up. I want
>>> the text box to change size as the user changes the size of the form.
>>> However, doing me.txtbox.width = me.width doesn't work, as the width
>>> value of the form doesn't seem to change, even as the form is resized
>>> by the user.
>>> How can get the textbox to always be the same size as the form that
>>> contains it?
>>
>> First, realize that the user is not resizing the form. They are resizing
>> the *window* that the form is hosted in and that IS different.
>>
>> You can use the Resize event of the form (confusing I know), and when the
>> window is made larger you will first have to make the form section where
>> the TextBox resides wider and/or taller and then resize the TextBox. If
>> the form is made smaller you have to first resize the TextBox and then
>> resize the form section. Doing these in the wrong order will cause an
>> error. You cannot make the TextBox domensions extend beyond the section
>> and you cannot make the section so small that it infringes on space
>> already being used by the TextBox. It gets a bit more complicated
>> because in one move the user can make the width smaller while making the
>> height greater or vise-versa.
>>
>> All of these adjustments will be relative to the InsideHeight and
>> InsideWidth properties of the form.
>>
>> I do this fairly often so users with higher resolution displays can make
>> a parent form taller so that they see more rows of a continuous subform
>> than the default. I also save the size in a table per user so that the
>> form opens that size the next time.
>>
>> --
>> Rick Brandt, Microsoft Access MVP
>> Email (as appropriate) to...
>> RBrandt at Hunter dot com
>>
>
>
Re: changing size of textbox to match form
am 06.11.2007 02:21:16 von Phil Reynolds
Right -- but how would I get the Top and Left values for the window before I
close it, so I can restore those values?
"BruceM" wrote in message
news:uAB7zR6HIHA.1188@TK2MSFTNGP04.phx.gbl...
> You can use the MoveSize function in the form's Open event. Help has more
> information, but in general you would use the Top and Left arguments only,
> and leave the Height and Width arguments blank since you have code to take
> care of that.
>
> "Phil Reynolds" wrote in message
> news:zD8Xi.91$0Q5.38@nlpi070.nbdc.sbc.com...
>> Hey, Rick. One more question for you. If I want to close and reopen the
>> form when the user moves to a new record, how can I place the form in the
>> same position on the screen as it was before it was closed. In other
>> words, the user has this pop-up form open; they move to a new record; the
>> OnCurrent event closes the form, then reopens it, using the InsideHeight
>> and InsideWidth properties to resize the form to how it was before it was
>> closed. But how put it in the same place on the screen where it was
>> before it was closed? Thanks.
>>
>> "Rick Brandt" wrote in message
>> news:if0Ui.2370$Bk.2078@newssvr19.news.prodigy.net...
>>> Phil Reynolds wrote:
>>>> I have a single text box (a large one) in a form that pops up. I want
>>>> the text box to change size as the user changes the size of the form.
>>>> However, doing me.txtbox.width = me.width doesn't work, as the width
>>>> value of the form doesn't seem to change, even as the form is resized
>>>> by the user.
>>>> How can get the textbox to always be the same size as the form that
>>>> contains it?
>>>
>>> First, realize that the user is not resizing the form. They are
>>> resizing the *window* that the form is hosted in and that IS different.
>>>
>>> You can use the Resize event of the form (confusing I know), and when
>>> the window is made larger you will first have to make the form section
>>> where the TextBox resides wider and/or taller and then resize the
>>> TextBox. If the form is made smaller you have to first resize the
>>> TextBox and then resize the form section. Doing these in the wrong
>>> order will cause an error. You cannot make the TextBox domensions
>>> extend beyond the section and you cannot make the section so small that
>>> it infringes on space already being used by the TextBox. It gets a bit
>>> more complicated because in one move the user can make the width smaller
>>> while making the height greater or vise-versa.
>>>
>>> All of these adjustments will be relative to the InsideHeight and
>>> InsideWidth properties of the form.
>>>
>>> I do this fairly often so users with higher resolution displays can make
>>> a parent form taller so that they see more rows of a continuous subform
>>> than the default. I also save the size in a table per user so that the
>>> form opens that size the next time.
>>>
>>> --
>>> Rick Brandt, Microsoft Access MVP
>>> Email (as appropriate) to...
>>> RBrandt at Hunter dot com
>>>
>>
>>
>
>
Re: changing size of textbox to match form
am 06.11.2007 14:43:47 von BruceM
You can use the WindowLeft and WindowTop properties to determine the values
needed for the first two arguments in the MoveSize property. Define the
variables in a standard module:
Public lngLeft As Long
Public lngTop As Long
Assign values in the form's Close event:
lngLeft = Me.WindowLeft
lngTop = Me.WindowTop
In the form's Open event:
DoCmd.MoveSize lngLeft, lngTop
If the values need to be stored for another session they would need to be
stored in a table rather than in a variable.
Storing the values should work in a split database in which every user has a
separate front end. I think you can have front-end tables in a split
database, but I am not certain how that works. If the database is not
split, and if it can have several users at once, it could become tricky to
set the values in such a way that each user will have customized settings.
Using the variables to store the values for the current session will
likewise become complex, I think, in a multi-user environment in which there
is no user-specific login and the database is not split. If this is an
issue in a multi-user environment, post details of the situation.
"Phil Reynolds" wrote in message
news:gkPXi.53004$RX.48855@newssvr11.news.prodigy.net...
> Right -- but how would I get the Top and Left values for the window before
> I close it, so I can restore those values?
>
> "BruceM" wrote in message
> news:uAB7zR6HIHA.1188@TK2MSFTNGP04.phx.gbl...
>> You can use the MoveSize function in the form's Open event. Help has
>> more information, but in general you would use the Top and Left arguments
>> only, and leave the Height and Width arguments blank since you have code
>> to take care of that.
>>
>> "Phil Reynolds" wrote in message
>> news:zD8Xi.91$0Q5.38@nlpi070.nbdc.sbc.com...
>>> Hey, Rick. One more question for you. If I want to close and reopen the
>>> form when the user moves to a new record, how can I place the form in
>>> the same position on the screen as it was before it was closed. In other
>>> words, the user has this pop-up form open; they move to a new record;
>>> the OnCurrent event closes the form, then reopens it, using the
>>> InsideHeight and InsideWidth properties to resize the form to how it was
>>> before it was closed. But how put it in the same place on the screen
>>> where it was before it was closed? Thanks.
>>>
>>> "Rick Brandt" wrote in message
>>> news:if0Ui.2370$Bk.2078@newssvr19.news.prodigy.net...
>>>> Phil Reynolds wrote:
>>>>> I have a single text box (a large one) in a form that pops up. I want
>>>>> the text box to change size as the user changes the size of the form.
>>>>> However, doing me.txtbox.width = me.width doesn't work, as the width
>>>>> value of the form doesn't seem to change, even as the form is resized
>>>>> by the user.
>>>>> How can get the textbox to always be the same size as the form that
>>>>> contains it?
>>>>
>>>> First, realize that the user is not resizing the form. They are
>>>> resizing the *window* that the form is hosted in and that IS
>>>> different.
>>>>
>>>> You can use the Resize event of the form (confusing I know), and when
>>>> the window is made larger you will first have to make the form section
>>>> where the TextBox resides wider and/or taller and then resize the
>>>> TextBox. If the form is made smaller you have to first resize the
>>>> TextBox and then resize the form section. Doing these in the wrong
>>>> order will cause an error. You cannot make the TextBox domensions
>>>> extend beyond the section and you cannot make the section so small that
>>>> it infringes on space already being used by the TextBox. It gets a bit
>>>> more complicated because in one move the user can make the width
>>>> smaller while making the height greater or vise-versa.
>>>>
>>>> All of these adjustments will be relative to the InsideHeight and
>>>> InsideWidth properties of the form.
>>>>
>>>> I do this fairly often so users with higher resolution displays can
>>>> make a parent form taller so that they see more rows of a continuous
>>>> subform than the default. I also save the size in a table per user so
>>>> that the form opens that size the next time.
>>>>
>>>> --
>>>> Rick Brandt, Microsoft Access MVP
>>>> Email (as appropriate) to...
>>>> RBrandt at Hunter dot com
>>>>
>>>
>>>
>>
>>
>
>
Re: changing size of textbox to match form
am 06.11.2007 18:16:22 von Davidb
> If the database is not split, and if it can have several users at once, it could become tricky to
> set the values in such a way that each user will have customized settings.
If so you have MUCH bigger issues than form resizing. In such a
situation it is not IF your database will become corrupted but WHEN.
Re: changing size of textbox to match form
am 07.11.2007 05:03:21 von Phil Reynolds
Thanks!
"BruceM" wrote in message
news:O1wLPsHIIHA.284@TK2MSFTNGP02.phx.gbl...
> You can use the WindowLeft and WindowTop properties to determine the
> values needed for the first two arguments in the MoveSize property.
> Define the variables in a standard module:
> Public lngLeft As Long
> Public lngTop As Long
>
> Assign values in the form's Close event:
> lngLeft = Me.WindowLeft
> lngTop = Me.WindowTop
>
> In the form's Open event:
> DoCmd.MoveSize lngLeft, lngTop
>
> If the values need to be stored for another session they would need to be
> stored in a table rather than in a variable.
>
> Storing the values should work in a split database in which every user has
> a separate front end. I think you can have front-end tables in a split
> database, but I am not certain how that works. If the database is not
> split, and if it can have several users at once, it could become tricky to
> set the values in such a way that each user will have customized settings.
>
> Using the variables to store the values for the current session will
> likewise become complex, I think, in a multi-user environment in which
> there is no user-specific login and the database is not split. If this is
> an issue in a multi-user environment, post details of the situation.
>
> "Phil Reynolds" wrote in message
> news:gkPXi.53004$RX.48855@newssvr11.news.prodigy.net...
>> Right -- but how would I get the Top and Left values for the window
>> before I close it, so I can restore those values?
>>
>> "BruceM" wrote in message
>> news:uAB7zR6HIHA.1188@TK2MSFTNGP04.phx.gbl...
>>> You can use the MoveSize function in the form's Open event. Help has
>>> more information, but in general you would use the Top and Left
>>> arguments only, and leave the Height and Width arguments blank since you
>>> have code to take care of that.
>>>
>>> "Phil Reynolds" wrote in message
>>> news:zD8Xi.91$0Q5.38@nlpi070.nbdc.sbc.com...
>>>> Hey, Rick. One more question for you. If I want to close and reopen the
>>>> form when the user moves to a new record, how can I place the form in
>>>> the same position on the screen as it was before it was closed. In
>>>> other words, the user has this pop-up form open; they move to a new
>>>> record; the OnCurrent event closes the form, then reopens it, using the
>>>> InsideHeight and InsideWidth properties to resize the form to how it
>>>> was before it was closed. But how put it in the same place on the
>>>> screen where it was before it was closed? Thanks.
>>>>
>>>> "Rick Brandt" wrote in message
>>>> news:if0Ui.2370$Bk.2078@newssvr19.news.prodigy.net...
>>>>> Phil Reynolds wrote:
>>>>>> I have a single text box (a large one) in a form that pops up. I want
>>>>>> the text box to change size as the user changes the size of the form.
>>>>>> However, doing me.txtbox.width = me.width doesn't work, as the width
>>>>>> value of the form doesn't seem to change, even as the form is resized
>>>>>> by the user.
>>>>>> How can get the textbox to always be the same size as the form that
>>>>>> contains it?
>>>>>
>>>>> First, realize that the user is not resizing the form. They are
>>>>> resizing the *window* that the form is hosted in and that IS
>>>>> different.
>>>>>
>>>>> You can use the Resize event of the form (confusing I know), and when
>>>>> the window is made larger you will first have to make the form
>>>>> section where the TextBox resides wider and/or taller and then resize
>>>>> the TextBox. If the form is made smaller you have to first resize the
>>>>> TextBox and then resize the form section. Doing these in the wrong
>>>>> order will cause an error. You cannot make the TextBox domensions
>>>>> extend beyond the section and you cannot make the section so small
>>>>> that it infringes on space already being used by the TextBox. It gets
>>>>> a bit more complicated because in one move the user can make the width
>>>>> smaller while making the height greater or vise-versa.
>>>>>
>>>>> All of these adjustments will be relative to the InsideHeight and
>>>>> InsideWidth properties of the form.
>>>>>
>>>>> I do this fairly often so users with higher resolution displays can
>>>>> make a parent form taller so that they see more rows of a continuous
>>>>> subform than the default. I also save the size in a table per user so
>>>>> that the form opens that size the next time.
>>>>>
>>>>> --
>>>>> Rick Brandt, Microsoft Access MVP
>>>>> Email (as appropriate) to...
>>>>> RBrandt at Hunter dot com
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Re: changing size of textbox to match form
am 11.11.2007 17:14:21 von Phil Reynolds
Actually, that doesn't work. There is not WindowLeft or WindowTop property
of a form in Access 2000. Those properties are not listed in the help
either.
So I'm still stuck with needing to know how to get the Top and Left values
for a window before I close it, so that I can restore those values when it's
reopened.
"BruceM" wrote in message
news:O1wLPsHIIHA.284@TK2MSFTNGP02.phx.gbl...
> You can use the WindowLeft and WindowTop properties to determine the
> values needed for the first two arguments in the MoveSize property.
> Define the variables in a standard module:
> Public lngLeft As Long
> Public lngTop As Long
>
> Assign values in the form's Close event:
> lngLeft = Me.WindowLeft
> lngTop = Me.WindowTop
>
> In the form's Open event:
> DoCmd.MoveSize lngLeft, lngTop
>
> If the values need to be stored for another session they would need to be
> stored in a table rather than in a variable.
>
> Storing the values should work in a split database in which every user has
> a separate front end. I think you can have front-end tables in a split
> database, but I am not certain how that works. If the database is not
> split, and if it can have several users at once, it could become tricky to
> set the values in such a way that each user will have customized settings.
>
> Using the variables to store the values for the current session will
> likewise become complex, I think, in a multi-user environment in which
> there is no user-specific login and the database is not split. If this is
> an issue in a multi-user environment, post details of the situation.
>
> "Phil Reynolds" wrote in message
> news:gkPXi.53004$RX.48855@newssvr11.news.prodigy.net...
>> Right -- but how would I get the Top and Left values for the window
>> before I close it, so I can restore those values?
>>
>> "BruceM" wrote in message
>> news:uAB7zR6HIHA.1188@TK2MSFTNGP04.phx.gbl...
>>> You can use the MoveSize function in the form's Open event. Help has
>>> more information, but in general you would use the Top and Left
>>> arguments only, and leave the Height and Width arguments blank since you
>>> have code to take care of that.
>>>
>>> "Phil Reynolds" wrote in message
>>> news:zD8Xi.91$0Q5.38@nlpi070.nbdc.sbc.com...
>>>> Hey, Rick. One more question for you. If I want to close and reopen the
>>>> form when the user moves to a new record, how can I place the form in
>>>> the same position on the screen as it was before it was closed. In
>>>> other words, the user has this pop-up form open; they move to a new
>>>> record; the OnCurrent event closes the form, then reopens it, using the
>>>> InsideHeight and InsideWidth properties to resize the form to how it
>>>> was before it was closed. But how put it in the same place on the
>>>> screen where it was before it was closed? Thanks.
>>>>
>>>> "Rick Brandt" wrote in message
>>>> news:if0Ui.2370$Bk.2078@newssvr19.news.prodigy.net...
>>>>> Phil Reynolds wrote:
>>>>>> I have a single text box (a large one) in a form that pops up. I want
>>>>>> the text box to change size as the user changes the size of the form.
>>>>>> However, doing me.txtbox.width = me.width doesn't work, as the width
>>>>>> value of the form doesn't seem to change, even as the form is resized
>>>>>> by the user.
>>>>>> How can get the textbox to always be the same size as the form that
>>>>>> contains it?
>>>>>
>>>>> First, realize that the user is not resizing the form. They are
>>>>> resizing the *window* that the form is hosted in and that IS
>>>>> different.
>>>>>
>>>>> You can use the Resize event of the form (confusing I know), and when
>>>>> the window is made larger you will first have to make the form
>>>>> section where the TextBox resides wider and/or taller and then resize
>>>>> the TextBox. If the form is made smaller you have to first resize the
>>>>> TextBox and then resize the form section. Doing these in the wrong
>>>>> order will cause an error. You cannot make the TextBox domensions
>>>>> extend beyond the section and you cannot make the section so small
>>>>> that it infringes on space already being used by the TextBox. It gets
>>>>> a bit more complicated because in one move the user can make the width
>>>>> smaller while making the height greater or vise-versa.
>>>>>
>>>>> All of these adjustments will be relative to the InsideHeight and
>>>>> InsideWidth properties of the form.
>>>>>
>>>>> I do this fairly often so users with higher resolution displays can
>>>>> make a parent form taller so that they see more rows of a continuous
>>>>> subform than the default. I also save the size in a table per user so
>>>>> that the form opens that size the next time.
>>>>>
>>>>> --
>>>>> Rick Brandt, Microsoft Access MVP
>>>>> Email (as appropriate) to...
>>>>> RBrandt at Hunter dot com
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Re: changing size of textbox to match form
am 11.11.2007 18:35:17 von lyle
On Nov 11, 11:14 am, "Phil Reynolds" wrote:
> Actually, that doesn't work.
"I couldn't make that work." is always kinder and almost always more
correct.
Here's some code.It works!
Does it work for what you want to do?
I can't find your code in this thread (is it there?) so I have no
idea.
Can you make it work?
I don't care.
May it help someone else?
I hope.
Private Declare Function GetWindowRect Lib "user32" _
(ByVal hWnd As Long, lpRect As Rectangle) As Long
Private Type Rectangle
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Public Function FormLeft&(ByRef Form As Form)
Dim FormRectangle As Rectangle
GetWindowRect Form.hWnd, FormRectangle
FormLeft = FormRectangle.Left
End Function
Public Function FormTop&(ByRef Form As Form)
Dim FormRectangle As Rectangle
GetWindowRect Form.hWnd, FormRectangle
FormLeft = FormRectangle.Top
End Function
Re: changing size of textbox to match form
am 12.11.2007 03:31:19 von Phil Reynolds
"lyle" wrote in message
news:1194802517.614478.186030@22g2000hsm.googlegroups.com...
> On Nov 11, 11:14 am, "Phil Reynolds" wrote:
>
>> Actually, that doesn't work.
>
> "I couldn't make that work." is always kinder and almost always more
> correct.
True. But in this case, since there is no WindowLeft or WindowTop property
in Access 2000, it just doesn't work.
But thanks for the ediquette tip.
Re: changing size of textbox to match form
am 12.11.2007 06:31:26 von arch
On Mon, 12 Nov 2007 02:31:19 GMT, "Phil Reynolds"
wrote:
>
>"lyle" wrote in message
>news:1194802517.614478.186030@22g2000hsm.googlegroups.com.. .
>> On Nov 11, 11:14 am, "Phil Reynolds" wrote:
>>
>>> Actually, that doesn't work.
>>
>> "I couldn't make that work." is always kinder and almost always more
>> correct.
>
>True. But in this case, since there is no WindowLeft or WindowTop property
>in Access 2000, it just doesn't work.
>
>But thanks for the ediquette tip.
>
They certainly do work, except for the small error in the second
function. It is because there is no WindowLeft or WindowTop
properties in Access 2000 that Lyle provided these very nice
functions.
Re: changing size of textbox to match form
am 12.11.2007 06:56:04 von lyle
On Nov 11, 12:35 pm, lyle wrote:
> On Nov 11, 11:14 am, "Phil Reynolds" wrote:
>
> > Actually, that doesn't work.
>
> "I couldn't make that work." is always kinder and almost always more
> correct.
>
> Here's some code.It works!
>
> Does it work for what you want to do?
> I can't find your code in this thread (is it there?) so I have no
> idea.
>
> Can you make it work?
> I don't care.
>
> May it help someone else?
> I hope.
>
> Private Declare Function GetWindowRect Lib "user32" _
> (ByVal hWnd As Long, lpRect As Rectangle) As Long
>
> Private Type Rectangle
> Left As Long
> Top As Long
> Right As Long
> Bottom As Long
> End Type
>
> Public Function FormLeft&(ByRef Form As Form)
> Dim FormRectangle As Rectangle
> GetWindowRect Form.hWnd, FormRectangle
> FormLeft = FormRectangle.Left
> End Function
>
> Public Function FormTop&(ByRef Form As Form)
> Dim FormRectangle As Rectangle
> GetWindowRect Form.hWnd, FormRectangle
> FormLeft = FormRectangle.Top
> End Function
Public Function FormTop&(ByRef Form As Form)
Dim FormRectangle As Rectangle
GetWindowRect Form.hWnd, FormRectangle
FormTop = FormRectangle.Top
End Function
Thanks, Arch.
Re: changing size of textbox to match form
am 12.11.2007 08:41:09 von Phil Reynolds
OK, you and Lyle are coming late to the game here, so I can see you're not
following completely.
This thread started with a question about resizing a textbox as a
form/window is resized. Rick Brandt answered that, and his solution worked
fine. No problem.
About a week later I replied to Rick again and asked how can I restore the
position of the window after the user closes it and reopens it, since
InsideHeight and InsideWidth (the properties that Rick referred me to for
resizing) only referred to the size.
Rick didn't respond, but then BruceM replied to use the MoveSize function to
restore that position. That was fine; but it didn't address how to store the
position parameters in the first place. So I replied to Bruce and asked how
I would get the Top and Left values for the window to store for later
reopening.
Bruce replied to use the WindowLeft and WindowTop properties to get to
position coordinates.
AND IT WAS TO THAT that I said, "That doesn't work. There is not WindowLeft
or WindowTop property of a form in Access 2000."
In other words, the question being asked was "How to get the Left and Top
properties," and the answer was, "Use WindowLeft and WindowTop." Those
properties don't exist in Access 2000, so the solution didn't work. Plain
and simple.
Thus, you wrote:
> They certainly do work, except for the small error in the second
> function.
Yes, but that was ALL that was being asked -- how to get the Left and Top
properties. And the answer was wrong. So, even if it was a "small error," it
was still 100% of what was being asked.
> It is because there is no WindowLeft or WindowTop
> properties in Access 2000 that Lyle provided these very nice
> functions.
Correct. And so Lyle's solution works, and the original didn't. What's the
issue here?
Please don't get me wrong. I do appreciate BruceM taking the time to help
me. And when I said, "That doesn't work," I was not being rude or
unappreciative. It was just a simple statement of fact. I asked how to get
the Left and Top values for a window. He said, "Use the WindowLeft and
WindowTop." But those properties don't exist in Access 2000, so I said,
"That doesn't work." What's the issue here?
"Arch" wrote in message
news:h4pfj3hp5pmc0nn7v0679eg29mtdk3ol1i@4ax.com...
> On Mon, 12 Nov 2007 02:31:19 GMT, "Phil Reynolds"
> wrote:
>
>>
>>"lyle" wrote in message
>>news:1194802517.614478.186030@22g2000hsm.googlegroups.com. ..
>>> On Nov 11, 11:14 am, "Phil Reynolds" wrote:
>>>
>>>> Actually, that doesn't work.
>>>
>>> "I couldn't make that work." is always kinder and almost always more
>>> correct.
>>
>>True. But in this case, since there is no WindowLeft or WindowTop property
>>in Access 2000, it just doesn't work.
>>
>>But thanks for the ediquette tip.
>>
>
> They certainly do work, except for the small error in the second
> function. It is because there is no WindowLeft or WindowTop
> properties in Access 2000 that Lyle provided these very nice
> functions.
Re: changing size of textbox to match form
am 12.11.2007 13:20:51 von BruceM
When I post questions I sometimes forget to provide version information, and
when I answer questions I tend to assume the person who asked has the same
version as I do. I think this thread demonstrates the importance of
providing version information. Had you mentioned Access 2000 I might have
remembered to provide the caveat that my reply is based on Access 2003, and
that I can't be sure it is in other versions.
In any case, I took your reply to mean just what you explained: that the
properties are not part of Access 2000. Glad to hear you found something
that works.
"Phil Reynolds" wrote in message
news:psTZi.68228$YL5.41512@newssvr29.news.prodigy.net...
> OK, you and Lyle are coming late to the game here, so I can see you're not
> following completely.
>
> This thread started with a question about resizing a textbox as a
> form/window is resized. Rick Brandt answered that, and his solution worked
> fine. No problem.
>
> About a week later I replied to Rick again and asked how can I restore the
> position of the window after the user closes it and reopens it, since
> InsideHeight and InsideWidth (the properties that Rick referred me to for
> resizing) only referred to the size.
>
> Rick didn't respond, but then BruceM replied to use the MoveSize function
> to restore that position. That was fine; but it didn't address how to
> store the position parameters in the first place. So I replied to Bruce
> and asked how I would get the Top and Left values for the window to store
> for later reopening.
>
> Bruce replied to use the WindowLeft and WindowTop properties to get to
> position coordinates.
>
> AND IT WAS TO THAT that I said, "That doesn't work. There is not
> WindowLeft or WindowTop property of a form in Access 2000."
>
> In other words, the question being asked was "How to get the Left and Top
> properties," and the answer was, "Use WindowLeft and WindowTop." Those
> properties don't exist in Access 2000, so the solution didn't work. Plain
> and simple.
>
> Thus, you wrote:
>
>> They certainly do work, except for the small error in the second
>> function.
>
> Yes, but that was ALL that was being asked -- how to get the Left and Top
> properties. And the answer was wrong. So, even if it was a "small error,"
> it was still 100% of what was being asked.
>
>> It is because there is no WindowLeft or WindowTop
>> properties in Access 2000 that Lyle provided these very nice
>> functions.
>
> Correct. And so Lyle's solution works, and the original didn't. What's the
> issue here?
>
> Please don't get me wrong. I do appreciate BruceM taking the time to help
> me. And when I said, "That doesn't work," I was not being rude or
> unappreciative. It was just a simple statement of fact. I asked how to get
> the Left and Top values for a window. He said, "Use the WindowLeft and
> WindowTop." But those properties don't exist in Access 2000, so I said,
> "That doesn't work." What's the issue here?
>
>
> "Arch" wrote in message
> news:h4pfj3hp5pmc0nn7v0679eg29mtdk3ol1i@4ax.com...
>> On Mon, 12 Nov 2007 02:31:19 GMT, "Phil Reynolds"
>> wrote:
>>
>>>
>>>"lyle" wrote in message
>>>news:1194802517.614478.186030@22g2000hsm.googlegroups.com ...
>>>> On Nov 11, 11:14 am, "Phil Reynolds" wrote:
>>>>
>>>>> Actually, that doesn't work.
>>>>
>>>> "I couldn't make that work." is always kinder and almost always more
>>>> correct.
>>>
>>>True. But in this case, since there is no WindowLeft or WindowTop
>>>property
>>>in Access 2000, it just doesn't work.
>>>
>>>But thanks for the ediquette tip.
>>>
>>
>> They certainly do work, except for the small error in the second
>> function. It is because there is no WindowLeft or WindowTop
>> properties in Access 2000 that Lyle provided these very nice
>> functions.
>
>
Re: changing size of textbox to match form
am 12.11.2007 16:15:08 von Phil Reynolds
Right -- I take responsiblity for not providing that version information.
And, as I noted, I don't really know what the issue is here, except that I
said, "It doesn't work," instead of, "I couldn't get it to work." But I
appreciate your taking the time to write either way! :-)
"BruceM" wrote in message
news:%238Nq4ZSJIHA.4592@TK2MSFTNGP02.phx.gbl...
> When I post questions I sometimes forget to provide version information,
> and when I answer questions I tend to assume the person who asked has the
> same version as I do. I think this thread demonstrates the importance of
> providing version information. Had you mentioned Access 2000 I might have
> remembered to provide the caveat that my reply is based on Access 2003,
> and that I can't be sure it is in other versions.
> In any case, I took your reply to mean just what you explained: that the
> properties are not part of Access 2000. Glad to hear you found something
> that works.
>
> "Phil Reynolds" wrote in message
> news:psTZi.68228$YL5.41512@newssvr29.news.prodigy.net...
>> OK, you and Lyle are coming late to the game here, so I can see you're
>> not following completely.
>>
>> This thread started with a question about resizing a textbox as a
>> form/window is resized. Rick Brandt answered that, and his solution
>> worked fine. No problem.
>>
>> About a week later I replied to Rick again and asked how can I restore
>> the position of the window after the user closes it and reopens it, since
>> InsideHeight and InsideWidth (the properties that Rick referred me to for
>> resizing) only referred to the size.
>>
>> Rick didn't respond, but then BruceM replied to use the MoveSize function
>> to restore that position. That was fine; but it didn't address how to
>> store the position parameters in the first place. So I replied to Bruce
>> and asked how I would get the Top and Left values for the window to store
>> for later reopening.
>>
>> Bruce replied to use the WindowLeft and WindowTop properties to get to
>> position coordinates.
>>
>> AND IT WAS TO THAT that I said, "That doesn't work. There is not
>> WindowLeft or WindowTop property of a form in Access 2000."
>>
>> In other words, the question being asked was "How to get the Left and Top
>> properties," and the answer was, "Use WindowLeft and WindowTop." Those
>> properties don't exist in Access 2000, so the solution didn't work. Plain
>> and simple.
>>
>> Thus, you wrote:
>>
>>> They certainly do work, except for the small error in the second
>>> function.
>>
>> Yes, but that was ALL that was being asked -- how to get the Left and Top
>> properties. And the answer was wrong. So, even if it was a "small error,"
>> it was still 100% of what was being asked.
>>
>>> It is because there is no WindowLeft or WindowTop
>>> properties in Access 2000 that Lyle provided these very nice
>>> functions.
>>
>> Correct. And so Lyle's solution works, and the original didn't. What's
>> the issue here?
>>
>> Please don't get me wrong. I do appreciate BruceM taking the time to help
>> me. And when I said, "That doesn't work," I was not being rude or
>> unappreciative. It was just a simple statement of fact. I asked how to
>> get the Left and Top values for a window. He said, "Use the WindowLeft
>> and WindowTop." But those properties don't exist in Access 2000, so I
>> said, "That doesn't work." What's the issue here?
>>
>>
>> "Arch" wrote in message
>> news:h4pfj3hp5pmc0nn7v0679eg29mtdk3ol1i@4ax.com...
>>> On Mon, 12 Nov 2007 02:31:19 GMT, "Phil Reynolds"
>>> wrote:
>>>
>>>>
>>>>"lyle" wrote in message
>>>>news:1194802517.614478.186030@22g2000hsm.googlegroups.co m...
>>>>> On Nov 11, 11:14 am, "Phil Reynolds" wrote:
>>>>>
>>>>>> Actually, that doesn't work.
>>>>>
>>>>> "I couldn't make that work." is always kinder and almost always more
>>>>> correct.
>>>>
>>>>True. But in this case, since there is no WindowLeft or WindowTop
>>>>property
>>>>in Access 2000, it just doesn't work.
>>>>
>>>>But thanks for the ediquette tip.
>>>>
>>>
>>> They certainly do work, except for the small error in the second
>>> function. It is because there is no WindowLeft or WindowTop
>>> properties in Access 2000 that Lyle provided these very nice
>>> functions.
>>
>>
>
>