Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

disable resize in browse window 1

Status
Not open for further replies.

Akourou

Programmer
Mar 28, 2019
34
0
0
GR
hello,

i use the following code to control browse window.

Code:
BROWSE NAME obrowin NOWAIT NODELETE NOMENU NORMAL FONT 'Arial', 10 ;
       FIELDS aa :7 ,descr :50 , p_price :7 

obrowin.width = 440
obrowin.height = 400
obrowin.top = 50
obrowin.left = 50
obrowin.allowheadersizing = .f.
obrowin.allowrowsizing = .f.
obrowin.allowrowsizing = .f.
obrowin.scrollbars = 0
FOR ii=1 TO obrowin.columncount
    thewobj = 'obrowin.column'+ALLTRIM(STR(ii))+'.resizable'
    thewobj1 = 'obrowin.column'+ALLTRIM(STR(ii))+'.movable'
    &thewobj = .f.
    &thewobj1 = .f.
NEXT

but the window can still be resized.
is there a property that can control resizing?

thank you.
 
The oBrowin isn't the window object, it's the grid object and it's parent property doesn't give you access to the outer border/Window/Form.
If you want to use Browse the legacy way, then first define a window and use the WINDOW clause of the BROWSE command.

Bye, Olaf.

Olaf Doschke Software Engineering
 
A better option might be to create a form, add a Grid control to it, and use the grid to display your data in place of the Browse. The grid can fill the entire form, and by adjusting the form's BorderWidth property, you can make it non-resizable.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike,

as DEFINE WINDOW allows to define a fixed form size (FROM..TO), even at a fixed position (NOFLOAT) and even with no border at all (NONE), you don't need to design a form.

But Akourou, the help topic of BROWSE explains "whose characteristics the Browse window assumes", that means the BROWSE command does create a form, a new own form. In a short experiment, the NONE-clause of DEFINE WINDOW and SHOW WINDOW does really only show a white rectangle but BROWSE still shows a form with titlebar and border. So it seems "assuming characteristics" has its limits.

On the other side, you can also create forms without titlebar and even without any border, but a form doesn't integrate into the legacy way of screens. A Grid also will mean mixing legacy and modern VFP controls, but you can position an OOP control object to a screen position translating pixels to a character position. A form also has left/top, yes, but even a borderless form will mean switching forms, that has some control tab order issues, I assume.

As I never programmed legacy screens, I only know the hearsay about using BROWSE within an application, to VFP developers it is only a developer tool for simple fast access to a DBF, not a feature of an application, as convenient as it may seem.

It makes me wonder if there is some setting, that would let BROWSE work fully compatible because it seems to have been used as the equivalent of a grid and not as the equivalence of a form in legacy VFP applications.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top