上一篇主題 :: 下一篇主題 |
發表人 |
內容 |
aforangel
註冊時間: 2010-05-24 文章: 117
第 1 樓
|
發表於: 星期二 十月 06, 2015 3:12 pm 文章主題: forms 位置 |
|
|
如果我把form.autocenter set .t., 每次DO FORM就會跳到正中間, 如果set .f., 就會跳到螢光幕左上角, 想問.....我可以把FORM的位置都跟據我_SCREEN的位置移動嗎? 因我_SCREEN不是設定為最大, 而且用家可以隨意移動位置 到螢光幕上下左右的 |
|
回頂端 |
|
 |
perry
註冊時間: 2014-07-20 文章: 203
第 2 樓
|
發表於: 星期二 十月 06, 2015 3:24 pm 文章主題: |
|
|
_Screen 移動時,表單不是會自動跟著移嗎??? |
|
回頂端 |
|
 |
aforangel
註冊時間: 2010-05-24 文章: 117
第 3 樓
|
發表於: 星期二 十月 06, 2015 6:07 pm 文章主題: |
|
|
就是沒有啊 |
|
回頂端 |
|
 |
aforangel
註冊時間: 2010-05-24 文章: 117
第 4 樓
|
發表於: 星期二 十月 06, 2015 6:07 pm 文章主題: |
|
|
用MOUSE按住_SCREEN在背後移動, FORM沒動 |
|
回頂端 |
|
 |
perry
註冊時間: 2014-07-20 文章: 203
第 5 樓
|
發表於: 星期二 十月 06, 2015 6:38 pm 文章主題: |
|
|
因您的表單 ShowWindow=2 ->頂層表單
若是我會在表單中增加2個變數記錄 _Screen.Top and _Screen.Left
proc init
this.var_top=_Screen.Top
this.var_left=_Screen.top
endproc
增加1組 Timer 隨時調整表單 Top,Left
Thisform.Top=Thisform.Top+_Screen.Top-Thisform.var_top
Thisform.Left=Thisform.Left+_Screen.Left-Thisform.var_left
但不太建議= =''' |
|
回頂端 |
|
 |
aforangel
註冊時間: 2010-05-24 文章: 117
第 6 樓
|
發表於: 星期三 十月 07, 2015 11:29 am 文章主題: |
|
|
Perry大大
我在FORM的init中用了這兩句
this.top=_Screen.Top
this.left=_Screen.left
是成功了, 但只限於開始時那一刻, 如果我FORM開了出來, 沒關閉, 中途因為阻礙視線而想移開_SCREEN, 那FORM就沒有跟著走, 有辦法能做到移動SCREEN, FORM也會跟著移動嗎? 除了說用TIMER的方法, 感覺不停檢查SCREEN位置會比較浪費資源 |
|
回頂端 |
|
 |
aforangel
註冊時間: 2010-05-24 文章: 117
第 7 樓
|
發表於: 星期三 十月 07, 2015 11:35 am 文章主題: |
|
|
另外, 我試過無論ShowWindow set 為 0,1,2 結果都一樣 |
|
回頂端 |
|
 |
215001
註冊時間: 2003-06-11 文章: 393
第 8 樓
|
發表於: 星期三 十月 07, 2015 11:53 am 文章主題: |
|
|
改成在FORM的 GotFocus 中用了這兩句看看
this.top=_Screen.Top
this.left=_Screen.left |
|
回頂端 |
|
 |
aforangel
註冊時間: 2010-05-24 文章: 117
第 9 樓
|
發表於: 星期三 十月 07, 2015 12:02 pm 文章主題: |
|
|
[quote="215001"]改成在FORM的 GotFocus 中用了這兩句看看
this.top=_Screen.Top
this.left=_Screen.left[/quote]
大大, 試過了, 也失敗, 結果跟放INIT一樣 |
|
回頂端 |
|
 |
perry
註冊時間: 2014-07-20 文章: 203
第 10 樓
|
發表於: 星期三 十月 07, 2015 12:48 pm 文章主題: |
|
|
_Screen 是系統變數
沒有 EVENT 可控制...
代碼: |
set sysm off
do form test1
read even
clos all
quit
*而表單
*showwindow=0 必須在scx 中修改屬性值,執行時期是唯讀@@
Proc Init
with this
.top=0
.left=0
.titlebar=0
.windowtype=0
endwith
_screen.width=this.width+2
_screen.height=this.height+2
_screen.autocenter=.t. &&啟動時置中
_screen.autocenter=.f. &&恢復為不置中
endproc
proc Release
clea even
endproc
|
|
|
回頂端 |
|
 |
|