Hello,my dear friends,thank you to open this code page。Here i post a solution to solve the problem of the zoom change in the platform of the winform in vbnet.Just enjoy this solution.(Please read the introduction before using it)。
In my solution,i try to use the txt to record the previous location in each controls and their sizes in the specify the folder(you can find this folder in your application path called Location)ok,now,let me demonstrate how to use it。
1.You should add this module in your solution
2.i am a Chinese first-year student who is studying anaesthesiology,because of the time limitations,i don‘t have the time to compete my traslation of this module,
so each part of it i will explain it to you
before using the adaptive module , you need to record your window state by your self,here i post 2 funtions to help you。
i advise you to use the "Left" alignment,it is more exactly!and if use the dock or the anchor at the same time.the effect will be better!
(1)funtion:窗体坐标记录文件生成 (window record)
you can use this function to record your whole form even the container in it.
窗体坐标记录文件生成(formname,if you want to adaptive with the container,Alignment,alignment in containers(if you choose the true inadaptive with the container but don‘t choose the alignment in your containers,the module will choose the alignment in form(property 3) as your alignment in containers)
let me give you a example
it is said i want to record my form1 and each container(if you choose the false,it will not record the controls in container) in my form1 ,meanwhile, i want to align in Left(my alignment is including Left Center Right,you should Strictly case ,the use of the " left" is banned,you can only use "Left"!!!or it will error!!!
then you can put this code in your click event or what else.when you finish record it.don't forget to delete this code!
(2)funtion:容器坐标文件生成(formname(Second-level folder name),parent-containername(the name of the file header like panel1textbox1’s panel1),containername,aligentment)
if you only use this funtion(2),i suggest you to use the formname as your parent-containername,let me give you a example。
it is said i want to create a folder called form1 in my location folder。and create a file called form1panel1 to record my location in panel1.what’s more?if you have
container in panel1,this function will record it ,too.Maybe create a file called panel1panel2. the panel2 is container。the panel1 is the parent container.you can use the
function 3 to decide whether to adjust the container in your selected container-panel1.
the funtion 3 and 4 must be based on the using of the function 1/2,you should use the funtion 1/2 before using the function 3/4
(3)function:窗体坐标记录文件分析(formname,if you want to adaptive with the container,(please do not use this optional property,it is a font correction which only suitble in my application)
just like
now the module will analysis the location file and your computer environment to adjust it!if you want to adaptive with the container,you must choose the function1
property2!you can put this code in your load or new event!
(4)function: 容器坐标记录文件分析(formname,parent-containername,containername,if you want to adaptive with the container)
please use the same name as your function 2!
just like in function 2 i use the 容器坐标记录文件生成(form1,form1,panel1,”Center")
in function 4 you must write 容器坐标记录文件分析(form1,form1,panel1,true or false)
forgive my poor english!i will use my free time to translate it!
in the end,please make sure each font must unit in the point or the piexl!!
welcome to ask me。 my email 1426887@qq.com Best wishes! LZN20221112
Name:  12123.png
Views: 586
Size:  281.2 KB