473,320 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

DataView?

Dear friends

A listbox on a Form1 is in the Form1.Load event filled with items from a
DataView. If I then hide the form and show it again all the items in the
listbox is duplicated. I dont know what causes this behaviour and didnt
believe the Form1 load event was fired again when showing the Form1 after
hiding. Do I have to erase the DataView before showing the form again and if
so how do I do this?

Somebody knows?

Regards Able
Nov 20 '05 #1
4 807
Hi!

You have to clear the listbox first.
ListBox.Items.Clear()
Thanks Joel :)
-----Original Message-----
Dear friends

A listbox on a Form1 is in the Form1.Load event filled

Nov 20 '05 #2
Cor
Hi Able,

This sounds strange, can you send some piece of code
(only the par from the page load and the hide and please first copied it to
a notebook and then copied and pasted back in the mail).

Maybe we can help you then.

Cor
Nov 20 '05 #3
Found this solution:

"Public Class MainClass
Public Shared Sub Main()
FirstForm = New Form1()
SecondForm = New Form2()
FirstForm.Show()
Application.Run()
End Sub

Private Shared m_FirstForm As Form1
Private Shared m_SecondForm As Form2

Public Shared Property FirstForm() As Form1
Get
Return m_FirstForm
End Get
Set(ByVal Value As Form1)
m_FirstForm = Value
End Set
End Property

Public Shared Property SecondForm() As Form2
Get
Return m_SecondForm
End Get
Set(ByVal Value As Form2)
m_SecondForm = Value
End Set
End Property
End Class
///

Set your project's startup object to MainClass.

Use this code to switch between the 2 forms:

\\\
Private Sub Button1_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs _
) Handles Button1.Click
MainClass.FirstForm.Hide()
MainClass.SecondForm.Show()
End Sub
///

You can use Application.Exit to shut down your application.

Notice that the way described above is only one possible solution...

Regards,
Herfried K. Wagner"
"Cor" <no*@non.com> skrev i melding
news:%2***************@TK2MSFTNGP11.phx.gbl...
Hi Able,

This sounds strange, can you send some piece of code
(only the par from the page load and the hide and please first copied it to a notebook and then copied and pasted back in the mail).

Maybe we can help you then.

Cor

Nov 20 '05 #4
Cor
Hi Able,

With that goes everything fine, I added this code in the load event of form1

Me.TextBox1.Text = Me.TextBox1.Text & "A"

This would mean, if I had that effect of, you that there would be after a
while a lot of A's but there was only one.

So this is not the problem.

Cor
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: RPI_alum | last post by:
I've been experiencing some frustrating behavior that I believe may be a MS bug in the Framework. Has anyone else experienced this, know a better way to resolve it, or if it is an actual MS bug ...
9
by: jwedel_stolo | last post by:
Hi I'm creating a dataview "on the fly" in order to sort some data prior to writing out the information to a MS SQL table I have used two methods in order to determine the sort order of the...
4
by: Martin Schmid | last post by:
I am trying to implement a DataView for a DataGrid so I can sort at runtime by clicking on column headers. My initial page load works... it displays the data However, when I click a column...
2
by: Alpha | last post by:
I have a window application. In one of the form, a datagrid has a dataview as its datasource. Initial filtering result would give the datavew 3 items. When I double click on the datagrid to edit...
36
by: kjvt | last post by:
Based on a prior posting, I've written a function to convert a recordset to a dataview. The first call to the function for a given recordset works perfectly, but the second call always returns a...
13
by: Steve | last post by:
I have a form with a dataset and a datagrid. I created a dataview on this dataset. When the user modifies the datagrid, I look up this record in the dataview to make sure it is unique. Here is...
5
by: David Wender | last post by:
I want to create a dataview with a sort on multiple columns. However, when I use FindRows, I only want to search some of the columns, not all. Is this possible? I have not been able to make it...
3
by: astro | last post by:
I have a datagrid that is two levels down from the dataview (i.e. grandchild). I have spent 3 hours trying to get the syntax of determining it's real datasource (i.e. not it's source based on it's...
5
by: enceladus311 | last post by:
I'm trying to find a way to keep from having to fill a DataView after every PostBack to a page. Basically, the design is that I have a DataView that I fill, which I then set as the DataSource to a...
0
by: Pravin Pujari | last post by:
Hi All, I am using .net framework 1.1 and c#. I have one problem regarding dataview. I have one dataview to which sorting may be applied or may not be applied. I have one UI component where I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.