Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi All,

How to hide the horizontalscroll property of a windows form

Please help

[Follow-up Question:]

What about the mdi form...
If the child forms are moved towards the corner of the mdi form then there is scroll bar in respective zones..
How can we remove it...
Posted
Updated 8-Apr-11 17:55pm
v2
Comments
walterhevedeich 8-Apr-11 3:32am    
The question is not clear. Do you want to hide just the horizontal scrollbar and not the vertical? Have you checked AutoScroll property on the form?

A form does not have a horizontal scroll bar by default: it will only appear if you enable the AutoScroll property - the same as for a Panel.

If you do enable AutoScroll, then you have no control over the individual scroll bars: they appear and disappear under the users control depending on the current visible width of the form.

If you don't want a horizontal scroll bar, then use the Anchor property of each control to tie it to the right hand side of the form: Then as the form is resized, the controls will move or resize so that they still fit, and no scroll bar will be displayed.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 8-Apr-11 23:56pm    
I moved a follow-up Question from OP to the original Question.
--SA
Make sure you set the AutoScroll property to false.

After that you can use the HorizontalScroll and VerticalScroll properties and Scroll event to set your own scrolling logic.

About MDI forms: I don't think it is possible to remove the scroll bars you are talking about. If you don't want scroll bars, then you have to use something different than MDI forms. Just keep the parent/child logic but without IsMdiContainer set to true.
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 8-Apr-11 23:56pm    
I moved a follow-up Question from OP to the original Question.
--SA
Sergey Alexandrovich Kryukov 8-Apr-11 23:57pm    
I hate the vote of "3" I see here; I voted 5.
--SA
Olivier Levrey 11-Apr-11 3:40am    
Thank you SA.
Vkmittal 19-Apr-16 7:05am    
clr.dll : 4.0.30319.34209 built by: FX452RTMGDR
dfdll.dll : 4.0.30319.34209 built by: FX452RTMGDR
dfshim.dll : 4.0.41209.0 (Main.041209-0000)

SOURCES
Deployment url : file:///C:/Users/truelogics/Downloads/HotelManagementSystem%20(9).application
Deployment Provider url : http://192.168.0.98/aa/HotelManagementSystem.application
Server : Microsoft-IIS/7.5
X-Powered-By : ASP.NET
Application url : http://192.168.0.98/aa/1.0.0.9/THMSSupport.exe.manifest
Server : Microsoft-IIS/7.5
X-Powered-By : ASP.NET

IDENTITIES
Deployment Identity : HotelManagementSystem, Version=1.0.0.9, Culture=neutral, PublicKeyToken=ee8af055b36ea864, processorArchitecture=msil
Application Identity : HotelManagementSystem, Version=1.0.0.9, Culture=neutral, PublicKeyToken=ee8af055b36ea864, processorArchitecture=msil, type=win32

APPLICATION SUMMARY
* Installable application.

ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\Users\truelogics\Downloads\HotelManagementSystem (9).application resulted in exception. Following failure messages were detected:
+ Reference in the manifest does not match the identity of the downloaded assembly THMSSupport.exe.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.

WARNINGS
There were no warnings during this operation.

OPERATION PROGRESS STATUS
* [04/19/2016 4:33:29 PM] : Activation of C:\Users\truelogics\Downloads\HotelManagementSystem (9).application has started.
* [04/19/2016 4:33:29 PM] : Processing of deployment manifest has successfully completed.
* [04/19/2016 4:33:29 PM] : Installation of the application has started.
* [04/19/2016 4:33:29 PM] : Processing of application manifest has successfully completed.
* [04/19/2016 4:33:55 PM] : Found compatible runtime version 2.0.50727.
* [04/19/2016 4:33:55 PM] : Detecting dependent assembly Sentinel.v3.5Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=msil using Sentinel.v3.5Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=msil.
* [04/19/2016 4:33:55 PM] : Detecting dependent assembly System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=msil using System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=msil.
* [04/19/2016 4:33:55 PM] : Detecting dependent assembly WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=msil using WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=msil.
* [04/19/2016 4:33:55 PM] : Detecting dependent assembly System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=msil using System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=msil.
* [04/19/2016 4:33:55 PM] : Request of trust and detection of platform is complete.

ERROR DETAILS
Following errors were detected during this operation.
* [04/19/2016 4:33:55 PM] System.Deployment.Application.InvalidDeploymentException (RefDefValidation)
- Reference in the manifest does not match the identity of the downloaded assembly THMSSupport.exe.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.DownloadManager.ProcessDownloadedFile(Object sender, DownloadEventArgs e)
at System.Deployment.Application.FileDownloader.DownloadModifiedEventHandler.Invoke(Object sender, DownloadEventArgs e)
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadDependencies(S

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900