Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB.NET
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB.NET General VB.NET discussions for issues that don't fall into other VB.NET forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 2nd, 2007, 04:00 AM
Registered User
 
Join Date: Mar 2007
Location: Islamabad, , Pakistan.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to doctorwcc
Default Design Time Exception in WinForm

Please read carefully about the problem i m facing. And help me please.
I have a form class called frmMgt.
frmMgt has a protected member i.e :
Protected WithEvents DGV as DatagridView

A form class frmProjectsMgt inherits frmMgt.
Another form class frmUnitsMgt also inherits frmMgt.

When I try to write the following event handler in any of the derived class, a warning is shown immediately, and when I try to switch from code view to design view of the derived class, the designer is not visible but a strange design time exception is shown
The event is:

'(in frmProjectManagement Form)

  Private Sub dgv_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEve ntArgs) Handles dgv.CellFormatting
        Dim row As DataGridViewRow
        For Each row In Me.dgv.Rows
            If row.Cells("Status").Value = "Sold" Then
                row.DefaultCellStyle.BackColor = Color.Blue
            End If
        Next
    End Sub

'Code Ended here
----------------

The warning says:
The event cellformatting is read-only and cannot be changed

When I switch to the design view I see the following alongwith a cross (critical error) icon:

One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes.

The event CellFormatting is read-only and cannot be changed.
Hide

at System.ComponentModel.Design.EventBindingService.E ventPropertyDescriptor.SetValue(Object component, Object value)
at System.ComponentModel.Design.Serialization.CodeDom SerializerBase.DeserializeAttachEventStatement(IDe signerSerializationManager manager, CodeAttachEventStatement statement)
at System.ComponentModel.Design.Serialization.CodeDom SerializerBase.DeserializeStatement(IDesignerSeria lizationManager manager, CodeStatement statement)

This also occur when I try to write DGV.CellContentClick event in the derived classes. But surprisingly, DGV.CellClick event in the derived class is causing no problems at all!
Further. The application causes no problems at run-time. All the problem is seen in the form designer. And the Error (warning) list does not show file name. And also tell that Line number: 0 and Column No: 0 in the errors list.
Why is this?
Why can't I write some of event handlers of a protected member of a base class in a derived class?

Regards







Hamid
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Resizing in Design Time Farside Visual Studio 2005 1 August 9th, 2007 06:42 PM
xxx_Init( ... ) design-time method? bradnerdhss BOOK: Professional Web Parts and Custom Controls ASP.NET ISBN: 0-7645-7860-X 3 August 8th, 2006 06:52 PM
Design-Time or Run-Time now ? ALGNET .NET Framework 2.0 1 July 31st, 2006 04:43 AM
Exception design on Boxoffice Sample Application? dleal BOOK: Professional Java Development with the Spring Framework 1 November 11th, 2005 06:31 AM



All times are GMT -4. The time now is 11:18 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.