Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2005

Tip: Looking for answers? Try searching our database.

SelectionRules property of the ControlDesigner class don't works

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
César F. Qüeb Montejo - 03 Feb 2005 17:35 GMT
Hi,

I'm developing an application that allow to the user place controls into a form (like design mode). The problem is that I need that the designer form can't be resized. The .NET documentation says that doing an overrides to the SelectionRules property and return the value that you want allow, avoid this feature (resize the control). Why my code don't works?. Any idea?. See the code for the usercontrol.

[code]
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Windows.Forms.Design
Imports System.Drawing

<Designer(GetType(CFQuebForm))> _
Public Class QForm
   Inherits UserControl

#Region " P R O P E R T I E S "

   <CategoryAttribute("QüebControl"), Description("Retorna la versión del componente"), Browsable(True)> _
   Public ReadOnly Property Version() As String
       Get
           Return "1.0"
       End Get
   End Property

   
   Public Sub New()
       MyBase.New()
       SetStyle(ControlStyles.ResizeRedraw, True)
       SetStyle(ControlStyles.Selectable, True)
       SetStyle(ControlStyles.SupportsTransparentBackColor, True)
       SetStyle(ControlStyles.FixedHeight, True)
       setstyle(ControlStyles.FixedWidth, True)
       Me.BackColor = Color.White
   End Sub

   Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
       MyBase.Size = New Size(250, 300)
   End Sub
End Class

Friend Class CFQuebForm
   Inherits ControlDesigner

   Public Overrides ReadOnly Property SelectionRules() As System.Windows.Forms.Design.SelectionRules
       Get
           Return SelectionRules.Locked
       End Get
   End Property

End Class
[/code]

Like you see... I had that overrides the OnResize event for restrict the control's resize. If you comment the overrides OnResize event, the user can resize the control, yet return SelectionRules.Locked in the overrides SelectionRules property.

Thank You for any help.
CFQüeb

PS.

If my control is an instance of the Form class, the problem is the same.
CFQüeb - 11 Feb 2005 22:59 GMT
Sorry for my insistence in this issue. Nobody has found the reason for
which the Overrides does not works?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.