Results 1 to 14 of 14

Thread: {RESOLVED} Issue with UITypeEditor in 2005

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    {RESOLVED} Issue with UITypeEditor in 2005

    I created my own user control. One of the properties uses the UITypeEditor to edit the property in the ide. But for some reason when I build the project it usually doesn't update any changes I have done to the property page.


    So I have a class that inherits the UITypeEditor. It overrides the getEditStyle and the EditValue functions. If I add a messagebox to the editvalue and then build it doesn't come up. Sometimes if I close my solution, reopen it and rebuild it the messagebox will start poping up. But then when I remove it and rebuild. It keeps poping up. But if I change something on the usercontrol, like add a label that change is always present.

    So it doesn't seem to be building the entire solution when I tell it to. Has anyone run into something similar?

    Thanks
    Last edited by mpdeglau; Dec 9th, 2005 at 02:03 PM.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Issue with UITypeEditor in 2005

    Do you have your test project as part of the Solution? Did you add the test project as the program to start when debugging? When you show your UITypeEditor is it a Modal Form, Dropdown List, or Color Picker, etc.?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: Issue with UITypeEditor in 2005

    Yes the test project is part of the same solution. Yes the test project has been set to start when debugging. The UITypeEditor is a modal form.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Issue with UITypeEditor in 2005

    Ok, so where is this messagebox supposed to show? While the Form is being displayed or after its dismissed? When you build your solution you could try "Rebuild Solution" instead of just "Build Solution".
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: Issue with UITypeEditor in 2005

    I have tried rebuild solution, and even clean, which appears to delete what's inside the bin folder.

    I've been adding the messagebox just to test to see if it is updating. I put it as the very first thing in the editvalue function. So it should pop up as the very first thing. And if I can actually manage to get it to build (which is random) this messagebox displays. But say the messagebox says "1" if I change it to say "2" and rebuild it will keep saying "1". Even if I close the solution reopen and rebuild. It doesn't matter if I build each propject seporatly.

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: Issue with UITypeEditor in 2005

    I have also tried having the copy dll property set to true and false. Doesn't matter each way. I have also deleted the reference in the test app and rereferenced it. Didn't do anything.

  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Issue with UITypeEditor in 2005

    Can you post your editvalue function?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: Issue with UITypeEditor in 2005

    VB Code:
    1. Public Overloads Overrides Function EditValue(ByVal context As System.ComponentModel.ITypeDescriptorContext, _
    2.     ByVal provider As System.IServiceProvider, ByVal Value As Object) As Object
    3.         Dim the_setting As MainTitleCollection
    4.         Dim dlg As New frmMainTitleProperty
    5.         Dim dlgResults As New DialogResult
    6.         MessageBox.Show("test") ' I have added this for testing.  At this point it doesnt show.
    7.         Try 'dont mind this its not staying just hard to debug when I dont know if it is building or not.
    8.             dlg.members = CType(Value, MainTitleCollection)
    9.         Catch
    10.         End Try
    11.         ' Display the editor form.
    12.         If dlg.ShowDialog() = DialogResult.OK Then
    13.             ' The user clicked OK. Use the new value.
    14.             If dlg.members Is Nothing OrElse dlg.members.Count = 0 Then
    15.                 the_setting = Nothing
    16.             Else
    17.                 the_setting = dlg.members
    18.             End If
    19.         Else
    20.             the_setting = CType(Value, MainTitleCollection)
    21.         End If
    22.         Return the_setting
    23.     End Function
    24. End Class

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: Issue with UITypeEditor in 2005

    If you would like to take a look at the entire project here it is.
    The class that inherits the typeEditor is called MenuItemsEditor. It in theCollections.vb
    it opens up the form frmMainTitleProperty.vb. To see the problem just add a messagebox as the first line in the EditValue function, or add a label to the frmMainTitleProperty form. Then rebuild. It shows up I would almost bet money that if you remove what ever you added, and build again it will still be there.

  10. #10
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Issue with UITypeEditor in 2005

    It looks like your not showing your form via the IWindowsFormsEditorService. This could be causing an issue when your creating new instances of your form and collection.

    This is an example of some code from one of my usercontrols. I am passing in a collection class to edit in the frmConfiguration. It shows as the elipisis button for my Collection property.


    VB Code:
    1. Imports System.Windows.Forms.Design
    2.  
    3. '...
    4.  
    5. <System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.Demand, Name:="FullTrust")> _
    6. Friend Class NavPanelTypeEditor
    7.  
    8.     Inherits UITypeEditor
    9.  
    10.     Public Overloads Overrides Function EditValue(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal provider As System.IServiceProvider, ByVal value As Object) As Object
    11.         'Attempts to obtain an IWindowsFormsEditorService.
    12.         Dim edSvc As IWindowsFormsEditorService = CType(provider.GetService(GetType(IWindowsFormsEditorService)), IWindowsFormsEditorService)
    13.         If edSvc Is Nothing Then
    14.             Return Nothing
    15.         End If
    16.  
    17.         'Displays a Custom Editor Form for editing the Collection
    18.         Dim form As New frmConfiguration(DirectCast(value, clsCollection))
    19.         If edSvc.ShowDialog(form) = DialogResult.OK Then
    20.             Return value
    21.         End If
    22.  
    23.         'If OK was not pressed, return the original value
    24.         Return value
    25.     End Function
    26.  
    27.     Public Overloads Overrides Function GetEditStyle(ByVal context As System.ComponentModel.ITypeDescriptorContext) As System.Drawing.Design.UITypeEditorEditStyle
    28.         ' Indicates that this editor can display a Form-based interface.
    29.         Return UITypeEditorEditStyle.Modal
    30.     End Function
    31.  
    32. End Class
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  11. #11

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: Issue with UITypeEditor in 2005

    Changing that seems to have partly worked. Now the dll does update the class and property form every time I restart the app. I'm starting to think this might be a bug. There doesn't seem to be any reason why the Class NavPanelTypeEditor wouldn't update after a build when the control itself does.

    Do you have any other ideas as what it could be?

  12. #12

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: Issue with UITypeEditor in 2005

    Just thought I would give an update:
    I posted a bug report on MSDN about this after not being able to figure this out with RobDogg's help and help on an MSDN forum. Microsoft was able to confirm the issue and they are working on a solution as of 12-6.

    I'll post the solution once I get it.

  13. #13
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Issue with UITypeEditor in 2005

    Cool, but I can only assume that the bug is just in 2005 only?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  14. #14

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,521

    Re: Issue with UITypeEditor in 2005

    I just got a response from MS yesterday. This is a bug in 05 and there will be a fix for it in the next update (whenever that will be).

    Thanks for all your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width