|
hey i have created my own custom property
the property is of type collection ,
it displays a form which allow the user to add a list of images and strings,
it stores the data in a collection ,
my problem is , i have noticed that after adding items to the collection at design time , there is no code generated in the .Designer file of the form and there for when i close the for / save it and reload it , all the items that i added to my custom property are gone.
my question , what did i miss here ? how do i make my custom property generate code at the .designer file for the items i have added to my property?
thanks.
Net
|
|
|
|
|
You have to tag the public properties you want the designer to write code for with the DesignerSerializationVisibility attribute. Like this:
DesignerSerializationVisibility(DesignerSerializationVisibility.Visible) _
Public Property MyControlProperty() as Integer
....
End Property
You can find the docs on the DesignerSerializationVisibility Attribute class here[^].
|
|
|
|
|
hey, this looks like a easy one but i'm stumped
For Each dal As ArrayList In My.Settings
dal.RemoveAt(Me.TabControl.SelectedIndex)
Next
basically what i am trying to do is for every arraylist remove a section of it, a error comes under my.settings saying that it is not a collection, can anyone help, thanks in advance
J.Hardy
|
|
|
|
|
Your settings is a collection of arraylists ? Are you sure ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
i has about 20 different arraylist in it, just trying to remove a section out of each 1
J.Hardy
|
|
|
|
|
Perhaps My.Settings is not a collection you can for each over, you can only access the values by name ? Or does My.Settings have a property that IS a collection, which you could use ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
well i had a look and could not find anything, sorry to ask this but can you give me a little more of a hint?
J.Hardy
|
|
|
|
|
I am on my Mac, I'd have to go and boot windows to have a dig around for you. I really don't know what My.Settings returns.
The Property Grid can iterate over your settings, so there has to be a property. Just hit . after My.Settings and look through, there's got to be something, otherwise your other option ( as it appears to be a machine generated class from a config file ) is to use reflection.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
ok, thanks
If at first you don't succeed
redefine success
J.Hardy
|
|
|
|
|
I am using asp.net 2 . I created a code for signout button .After signout ,When clicking the browser's back button it will go back to login page.Give me good solution for it...
|
|
|
|
|
Well, this question is asked a lot, just generally by people smart enough to post in the right forum.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi , I’m doing a little experiment.
I created procedures that can create new forms at run time.
------------------------------------------
Private Sub createForms()
Dim i As Integer
For i = 1 To 10
newform = New Form
newform.Name = "Form_" + i.ToString
newform.Show()
Next
End Sub
------------------------------------------
Now I want to move those forms on the screen, close them one by one, change size etc.
I cant find the way to acces the forms that I just created. I tried using newform.Name property but it dosent work.
Any suggestions???
Thanks
|
|
|
|
|
I am using Visual Studio 2008
I thought it might help if I mention this info.
Thanks
|
|
|
|
|
The newform variable can't be accessed outside of the FOR loop. I recommend making the form a global variable.
How many bytes of text have I typed in my lifetime??? Man, I wish I kept track...
|
|
|
|
|
But, he's creating 10 of them, not just one.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
As newform is created over an over, you are basically throwing away your reference to the new forms. The Application.Forms collection is one way to find them, but you can also build your own list and keep references that are strongly typed in that.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanks Christian for reply.
Could you please give me a sample of how to use Application.Forms collection for my purpose?
Thank you.
|
|
|
|
|
Thank you for the inputs.
If I would do the newform global, how then i can access and change individual forms properties?
Does some one can give me a workable solution
Thanks again.
|
|
|
|
|
I'm rewriting a VB6 application (DLL) using VB.net 2005. In my VB6 app I used "App.hInstance" to acquire the applications Instance handle. In my VB.net 2005 module I’m trying to use "Public Function GetHINSTANCE (m As Module) As IntPtr". But ‘Module’ keeps flagging as an error “keyword doe not name a type.” What am I missing?
Any suggestion?
Curt
|
|
|
|
|
I believe it's called Handle in .NET. At least, I think it's called that in C#.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
Hello,
I would like to show the properties of an objet that contains another object .
Here is a simplified example :
'Imports
<DefaultPropertyAttribute("Gestion parametres")> _
<Serializable()> _
<XmlRootAttribute(Namespace:="", ElementName:="PARAM", IsNullable:=False)> _
Public Class Cls_Param
Public _MyclsTest As new clsTest
Public Property MyclsTest() As clsTest
Get
Return _MyclsTest
End Get
Set(ByVal value As clsTest)
_MyclsTest = value
End Set
End Property
<Serializable()> _
Public Class clsTest
Private _AppName As String
<CategoryAttribute("Application"), _
Browsable(True), _
[ReadOnly](False), _
BindableAttribute(False), _
DesignOnly(False), _
DescriptionAttribute("Le nom de l'application"), _
XmlAttribute(AttributeName:="AppName")> _
Public Property AppName() As String
Get
Return _AppName
End Get
Set(ByVal value As String)
_AppName = value
End Set
End Property
End class
Public Sub New()
_MyclsTest = New clsTest
End Sub
End Class
In my form :
Public G_Param As New Cls_Param
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.PropertyGrid1.SelectedObject = G_Param
End Sub
if i choose :
Me.PropertyGrid1.SelectedObject = G_Param.cls_test , this works fine and i can see the object properties.
In the other hand, i want to give the object :
Me.PropertyGrid1.SelectedObject = G_Param , but this doesn't work.
How can i do this ?
Thanks.
|
|
|
|
|
You may want to look into the ExpandableObjectConvertor class. Add it as an attribute to your property like so: <TypeConvertor(GetType(ExpandableObjectConvertor))>
|
|
|
|
|
I have tried but it doesn't resolved the problem
|
|
|
|
|
how can i delete database records using code?
my code is
me.validate()
me.GuestBindingSource.remove()
but this code is wrong ,what would the right way?
|
|
|
|