|
my first guess would be that you forgot to display the items already in the list. That would result in not being able to see the items but that they are there.
In the load of you're second control (the collection editor) you should put something like this:
if p_collection.count >0 then
for each p as panelitem in p_collection
'display it
next
end if
without more code I can't really be shure about it
if you want to store this collection even after you're application has shutdown you will have to use a database or file or you can look into serialisation (not shure if its spelled correctly )
I'm not familiar with the treeview node collection editor but I'll take a look at it on my break
|
|
|
|
|
no i'm not trying to store a collection after i've shutdown the application, i'm trying to achieve functionality similar to a treeview. Go into a new project and add a treeview to the form, then add to it's nodes property a few nodes, then close the collection editor of the treeview and reopen it, the nodes you added are available to be edited, this is what i'm trying to achieve.
|
|
|
|
|
Ok I took a look at it (first time I did it that way I always do it in code)
I would think that the way you do it should work. Can you provide me with the load of the collection editor or/and constructor. that way I can try to reproduce the error you have and search for a solution
|
|
|
|
|
well what i've already shown you is all i've done, it's not real complex, just two controls that inherit Panel and one has the property i've already shown, in this way it creates its own collecton editor without me having to do it manually, but i'm starting to think that i should be doing it manually, how would i go about that?
|
|
|
|
|
Ok I'v recreated you're problem I'll take a look at it on my break wich is in about 2hours and let you know
|
|
|
|
|
|
Just stumbled on to something. I can't keep myself from trying to solve this (don't know why )
Here is the problem: a panel hasn't got a collection property by default so the collection editor (wich only displays because the property is a list) doesn't know what to do with it.
At first glance I don't think you will be able to achieve that what you want with a panel. Perhaps inheriting from a treeview will work better or a listview. But whitout knowing what exactly this custom control has to accomplish I don't know wich will be better.
Another option is ofcourse to do everything manually but I can't help you with that (haven't done that) and it is probably going to be alot of work. You'll probably have to draw the control you'r self.
If you tell me what functionality you are trying to accomplish perhaps I can help you search for a way to do that
|
|
|
|
|
I just can't stop searching
but I found a possibilaty
to accomplish something like this you have to use a property that already exists in a standerd panel and the only one that exists is the controls property so in you first custom control change you're property to this:
Private p As List(Of mainsub)
Public Overloads Property controls() As List(Of mainsub)
Get
Return p
End Get
Set(ByVal value As List(Of mainsub))
p = value
End Set
End Property
you can change the name of p and of mainsub but not of the property. the property must be controls
if you do this the collection editor will work
hope this helps
-- modified at 5:24 Thursday 30th August, 2007
there still seems to be a problem when you run the prog I take another look at it on my break (really need to get back to work now;P)
|
|
|
|
|
WOW! You've been a great help, haven't had a chance to try this stuff yet and the one below looks helpful also, i agree, it's an annoying puzzle that you hope has a simple answer and wel...it might not but thankyou heaps.
|
|
|
|
|
The problem is that you've added items into the collection but it is not "saved" in the InitializeComponent() part of the computer generated code. It is not persisted.
Consider reading this:
http://www.codeproject.com/csharp/dzcollectioneditor.asp
and maybe this
http://www.codeproject.com/csharp/collcontrolsrichdes.asp
|
|
|
|
|
hi all
I don't know how I con unload form in the vb.net with destroy all objects
plz help me
thanks alot
bye
|
|
|
|
|
hi,
You can use Dispose method.
Regards,
Paramhans Dubey.
|
|
|
|
|
Firstly dont learn Programming from Scratch on Forums. you can buy a book in VB.net and Download some e-books. now if you were using vb6, then it will be
unload Form1
in Vb.net a form is a class. so you have to create an instance of a Class. lets say i have a Form named "myform"
if i was to destroy all objects, i will say.
Dim objForm1 As New Form1
objForm1.Dispose()
But please my friend, take my advice and buy a book.
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding
|
|
|
|
|
Hi, anybody who knows how to highlight the first row of a listview after you populate the data from table? Thanks
-- modified at 1:20 Thursday 30th August, 2007
angel
|
|
|
|
|
Does
xxx.Items(0).Selected = True
(where xxx is your list view) not work?
|
|
|
|
|
Thanks Jayson. But it did'nt work
angel
|
|
|
|
|
Hi, I have a problem when loading an MDI child form. I have develop an application in vb2005. My windows application form was running fine from the past. But this morning when I try to load the form, its dipslay the following error:
System.InvalidOperationException was unhandled<br />
Message="An error occurred creating the form. See Exception.InnerException for details. The error is: Conversion from string "" to type 'Long' is not valid."<br />
Source="DIC Donor Database"<br />
StackTrace:<br />
at DIC_Donor_Database.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190<br />
at DIC_Donor_Database.My.MyProject.MyForms.get_frmDelProgBud()<br />
at DIC_Donor_Database.mdiDonorDb.mnuDelProgBud_Click(Object sender, EventArgs e) in C:\Documents and Settings\roathkanel\My Documents\Visual Studio 2005\Projects\DIC Donor Database\DIC Donor Database\mdiDonorDb.vb:line 57<br />
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)<br />
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)<br />
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)<br />
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)<br />
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)<br />
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)<br />
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)<br />
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)<br />
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)<br />
at System.Windows.Forms.Control.WndProc(Message& m)<br />
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)<br />
at System.Windows.Forms.ToolStrip.WndProc(Message& m)<br />
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)<br />
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)<br />
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)<br />
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)<br />
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)<br />
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)<br />
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)<br />
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)<br />
at System.Windows.Forms.Application.Run(ApplicationContext context)<br />
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()<br />
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()<br />
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)<br />
at DIC_Donor_Database.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81<br />
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)<br />
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)<br />
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()<br />
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)<br />
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<br />
at System.Threading.ThreadHelper.ThreadStart()
Could anyone tell me what is the problem? And how could I solve the problem?
|
|
|
|
|
According to the error message it is a simple conversion error somewhere. Apparently some query or something, that runs in the load event of your form, is returning a null value, or an empty string. It should probably return a number.
The best thing to do is to run your app in debug mode, and set the break point at the load event of your app.
First thing that comes to mind however is that you need to check your data, or adapt a query with ISNULL() statements to return at least 0, because it has started throwing this error all of a sudden.
Good luck,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
The below is the code in the form load procedure:
' Clear information on the form.<br />
lblGovContPrevDb.Text = ""<br />
lblOwnConPrevDb.Text = ""<br />
lvwLG.Items.Clear()<br />
lblTotalLG.Text = "Total Loan:" & ControlChars.CrLf & "Total Grant:"<br />
' Disable the group of loan and grant.<br />
gpbLG.Enabled = False
I don't know what is cause the problem. Please help me to fine the soultion.
|
|
|
|
|
The error message contains this line:
mdiDonorDb.vb:line 57
You could turn on line numbering in your editor and check to see what code you can find at that position.
My advice is free, and you may get what you paid for.
|
|
|
|
|
Johan Hakkesteegt wrote: The error message contains this line:
mdiDonorDb.vb:line 57
The below is the code that I copy from my application.
Private Sub mnuDelProgBud_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuDelProgBud.Click<br />
<br />
frmDelProgBud.ShowDialog()<br />
<br />
End Sub
I couldn't find any solution. Please help me.
|
|
|
|
|
Did you try to run your app in debug mode, with the break point set at the first line in the load event of the form?
Does the app ever even get to the breakpoint?
My advice is free, and you may get what you paid for.
|
|
|
|
|
Johan Hakkesteegt wrote: Did you try to run your app in debug mode, with the break point set at the first line in the load event of the form?
Does the app ever even get to the breakpoint?
Yes, thank you for you advice. Now I found the problem that cause my system run incorrectly. Thank you very much for your help
|
|
|
|
|
I am having one query. I am having one parent folder which contains executable files and reports folder. i am having 6 databases by which each and every client will access the respective databases. Each client will access the same executables .The problem i am facing that if a client access the a report its report source is stored in the report 4.3. After sometime if another client access the same report it is showing the details of earlier accessed database. i want to change the report source.Please help me.
Sivaraman.
|
|
|
|
|
Dear friends,
When I make a tiff documents and print it with vb.net system.diagnosis.process and setting the verb as print, the spool size it huge.
I guess its the problem with the quality parameter. But how to overcome this?
Thanks,
|
|
|
|