|
-
Nov 17th, 2005, 01:18 PM
#1
Thread Starter
Frenzied Member
{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.
-
Nov 17th, 2005, 01:57 PM
#2
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Nov 17th, 2005, 02:00 PM
#3
Thread Starter
Frenzied Member
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.
-
Nov 17th, 2005, 02:05 PM
#4
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Nov 17th, 2005, 02:10 PM
#5
Thread Starter
Frenzied Member
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.
-
Nov 17th, 2005, 02:13 PM
#6
Thread Starter
Frenzied Member
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.
-
Nov 17th, 2005, 02:29 PM
#7
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Nov 17th, 2005, 02:33 PM
#8
Thread Starter
Frenzied Member
Re: Issue with UITypeEditor in 2005
VB Code:
Public Overloads Overrides Function EditValue(ByVal context As System.ComponentModel.ITypeDescriptorContext, _
ByVal provider As System.IServiceProvider, ByVal Value As Object) As Object
Dim the_setting As MainTitleCollection
Dim dlg As New frmMainTitleProperty
Dim dlgResults As New DialogResult
MessageBox.Show("test") ' I have added this for testing. At this point it doesnt show.
Try 'dont mind this its not staying just hard to debug when I dont know if it is building or not.
dlg.members = CType(Value, MainTitleCollection)
Catch
End Try
' Display the editor form.
If dlg.ShowDialog() = DialogResult.OK Then
' The user clicked OK. Use the new value.
If dlg.members Is Nothing OrElse dlg.members.Count = 0 Then
the_setting = Nothing
Else
the_setting = dlg.members
End If
Else
the_setting = CType(Value, MainTitleCollection)
End If
Return the_setting
End Function
End Class
-
Nov 17th, 2005, 02:54 PM
#9
Thread Starter
Frenzied Member
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.
-
Nov 17th, 2005, 11:38 PM
#10
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:
Imports System.Windows.Forms.Design
'...
<System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.Demand, Name:="FullTrust")> _
Friend Class NavPanelTypeEditor
Inherits UITypeEditor
Public Overloads Overrides Function EditValue(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal provider As System.IServiceProvider, ByVal value As Object) As Object
'Attempts to obtain an IWindowsFormsEditorService.
Dim edSvc As IWindowsFormsEditorService = CType(provider.GetService(GetType(IWindowsFormsEditorService)), IWindowsFormsEditorService)
If edSvc Is Nothing Then
Return Nothing
End If
'Displays a Custom Editor Form for editing the Collection
Dim form As New frmConfiguration(DirectCast(value, clsCollection))
If edSvc.ShowDialog(form) = DialogResult.OK Then
Return value
End If
'If OK was not pressed, return the original value
Return value
End Function
Public Overloads Overrides Function GetEditStyle(ByVal context As System.ComponentModel.ITypeDescriptorContext) As System.Drawing.Design.UITypeEditorEditStyle
' Indicates that this editor can display a Form-based interface.
Return UITypeEditorEditStyle.Modal
End Function
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Nov 18th, 2005, 10:51 AM
#11
Thread Starter
Frenzied Member
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?
-
Dec 7th, 2005, 11:36 AM
#12
Thread Starter
Frenzied Member
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.
-
Dec 9th, 2005, 02:00 PM
#13
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Dec 9th, 2005, 02:02 PM
#14
Thread Starter
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|