473,385 Members | 1,356 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,385 software developers and data experts.

Bug in .NET panel control? Or am I missing something?

OK, check this out...

I have a form with a panel control and button on it (outside the panel
control).

I have two event handlers - one handles the click event of the button on the
form. The other handles a custom "CardInserted" event for a class I wrote
that watches for smart cards to be inserted into an attached smart card
reader.

BOTH event handlers have the *exact* same code in them - which is to add a
new button control into the panel control whenever the event fires.

The code for the button's click event works just fine - buttons get added to
the panel control without any problem.

The code for my "CardInserted" event - which is the EXACT same code as the
button.click code does NOT work. The event gets raised (verified), the code
runs (verified), but it STOPS running at the panel.controls.add(newbutton)
line. It doesn't throw an error, it just stops running and no button gets
added. The program continues to run and I can keep adding buttons to the
panel control via the form's button.click, but the "CardInserted" code
simply will not run - *despite being the same code as the button.click
code*!

I tried swapping out the panel.controls.add(newbutton) line with a simple
"msgbox panel.controls.count" and that works just fine - so I can see the
panel control from the CardInserted event. I can even do a
"panel.controls.remove" command if I want - I just can't ADD a new control
during my CardInserted event handler.

I'm totally confused. Why would I be unable to run code that works for
button.click under my CardInserted event handler? The ONLY thing I can't do
is add a control.

Why is this? Is it a bug in the panel control?
Nov 20 '05 #1
11 1871
I set up a super-streamlined app with only the essential elements. It's one
form with a panel control and a button on it.

The stuff in form_load is to get my CardInserted event to fire. When I
insert a smart card, the "Card Inserted" msgbox command goes off, the
"Adding Button" msgbox command goes off, but the "Button Added" msgbox
command does NOT fire. It does fire when the Add sub is called from
Button1_Click.

So *something* is not allowing that panel1.controls.add(pButton) command to
execute.

The code behind the form looks like this:

Private mintIndex As Integer
Private WithEvents mBECardReaderManager As BECardReaderManager

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
AddButton()
End Sub

Private Sub mBECardReaderManager_BECardInserted(ByVal eCardReaderName As
String, ByVal eCardReaderNumber As Integer, ByVal eCardID As String) Handles
mBECardReaderManager.BECardInserted
MsgBox("Card Inserted")
AddButton()
End Sub

Private Sub AddButton()
Dim pButton As New Button
pButton.Height = 50
pButton.Width = 100
pButton.Left = (mintIndex Mod 5) * 100
pButton.Top = (mintIndex \ 5) * 50
pButton.Text = "Button #" & mintIndex
mintIndex = mintIndex + 1
MsgBox("Adding Button")
Panel1.Controls.Add(pButton)
MsgBox("Button Added")
End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles MyBase.Load
Dim mBEReg As New BERegistrySettings
mBEReg.LoadRegistrySettings()
mBECardReaderManager = New BECardReaderManager
mBECardReaderManager.Initialize(mBEReg)
End Sub
Nov 20 '05 #2
Hi

Does your CardInserted event get raised by a different thread?

If so, you will not be able to access the panel in the way you are trying.
Windows control are not thread safe. You can only access them (with a couple
of exceptions) on the thread that they were created on. You need to use
Panel1.Invoke in order to pass a delegate to the panel which it can then use
for adding the button.

HTH

Charles
"BoloBaby" <bo******@hotmail.com> wrote in message
news:1o********************@comcast.com...
I set up a super-streamlined app with only the essential elements. It's one form with a panel control and a button on it.

The stuff in form_load is to get my CardInserted event to fire. When I
insert a smart card, the "Card Inserted" msgbox command goes off, the
"Adding Button" msgbox command goes off, but the "Button Added" msgbox
command does NOT fire. It does fire when the Add sub is called from
Button1_Click.

So *something* is not allowing that panel1.controls.add(pButton) command to execute.

The code behind the form looks like this:

Private mintIndex As Integer
Private WithEvents mBECardReaderManager As BECardReaderManager

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
AddButton()
End Sub

Private Sub mBECardReaderManager_BECardInserted(ByVal eCardReaderName As
String, ByVal eCardReaderNumber As Integer, ByVal eCardID As String) Handles mBECardReaderManager.BECardInserted
MsgBox("Card Inserted")
AddButton()
End Sub

Private Sub AddButton()
Dim pButton As New Button
pButton.Height = 50
pButton.Width = 100
pButton.Left = (mintIndex Mod 5) * 100
pButton.Top = (mintIndex \ 5) * 50
pButton.Text = "Button #" & mintIndex
mintIndex = mintIndex + 1
MsgBox("Adding Button")
Panel1.Controls.Add(pButton)
MsgBox("Button Added")
End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim mBEReg As New BERegistrySettings
mBEReg.LoadRegistrySettings()
mBECardReaderManager = New BECardReaderManager
mBECardReaderManager.Initialize(mBEReg)
End Sub

Nov 20 '05 #3
I have not set up any multithreading within my application.

Oddly enough, I can access the panel control to display a
panel.controls.count or even perform a panel.controls.remove - just can't
add.
"Charles Law" <bl***@nowhere.com> wrote in message
news:eL**************@tk2msftngp13.phx.gbl...
Hi

Does your CardInserted event get raised by a different thread?

If so, you will not be able to access the panel in the way you are trying.
Windows control are not thread safe. You can only access them (with a couple of exceptions) on the thread that they were created on. You need to use
Panel1.Invoke in order to pass a delegate to the panel which it can then use for adding the button.

HTH

Charles
"BoloBaby" <bo******@hotmail.com> wrote in message
news:1o********************@comcast.com...
I set up a super-streamlined app with only the essential elements. It's

one
form with a panel control and a button on it.

The stuff in form_load is to get my CardInserted event to fire. When I
insert a smart card, the "Card Inserted" msgbox command goes off, the
"Adding Button" msgbox command goes off, but the "Button Added" msgbox
command does NOT fire. It does fire when the Add sub is called from
Button1_Click.

So *something* is not allowing that panel1.controls.add(pButton) command

to
execute.

The code behind the form looks like this:

Private mintIndex As Integer
Private WithEvents mBECardReaderManager As BECardReaderManager

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
AddButton()
End Sub

Private Sub mBECardReaderManager_BECardInserted(ByVal eCardReaderName As
String, ByVal eCardReaderNumber As Integer, ByVal eCardID As String)

Handles
mBECardReaderManager.BECardInserted
MsgBox("Card Inserted")
AddButton()
End Sub

Private Sub AddButton()
Dim pButton As New Button
pButton.Height = 50
pButton.Width = 100
pButton.Left = (mintIndex Mod 5) * 100
pButton.Top = (mintIndex \ 5) * 50
pButton.Text = "Button #" & mintIndex
mintIndex = mintIndex + 1
MsgBox("Adding Button")
Panel1.Controls.Add(pButton)
MsgBox("Button Added")
End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As

System.EventArgs)
Handles MyBase.Load
Dim mBEReg As New BERegistrySettings
mBEReg.LoadRegistrySettings()
mBECardReaderManager = New BECardReaderManager
mBECardReaderManager.Initialize(mBEReg)
End Sub


Nov 20 '05 #4
If the API handling the smartcard readers in multithreaded, could THAT cause
the problem?
"Charles Law" <bl***@nowhere.com> wrote in message
news:eL**************@tk2msftngp13.phx.gbl...
Hi

Does your CardInserted event get raised by a different thread?

If so, you will not be able to access the panel in the way you are trying.
Windows control are not thread safe. You can only access them (with a couple of exceptions) on the thread that they were created on. You need to use
Panel1.Invoke in order to pass a delegate to the panel which it can then use for adding the button.

HTH

Charles
"BoloBaby" <bo******@hotmail.com> wrote in message
news:1o********************@comcast.com...
I set up a super-streamlined app with only the essential elements. It's

one
form with a panel control and a button on it.

The stuff in form_load is to get my CardInserted event to fire. When I
insert a smart card, the "Card Inserted" msgbox command goes off, the
"Adding Button" msgbox command goes off, but the "Button Added" msgbox
command does NOT fire. It does fire when the Add sub is called from
Button1_Click.

So *something* is not allowing that panel1.controls.add(pButton) command

to
execute.

The code behind the form looks like this:

Private mintIndex As Integer
Private WithEvents mBECardReaderManager As BECardReaderManager

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
AddButton()
End Sub

Private Sub mBECardReaderManager_BECardInserted(ByVal eCardReaderName As
String, ByVal eCardReaderNumber As Integer, ByVal eCardID As String)

Handles
mBECardReaderManager.BECardInserted
MsgBox("Card Inserted")
AddButton()
End Sub

Private Sub AddButton()
Dim pButton As New Button
pButton.Height = 50
pButton.Width = 100
pButton.Left = (mintIndex Mod 5) * 100
pButton.Top = (mintIndex \ 5) * 50
pButton.Text = "Button #" & mintIndex
mintIndex = mintIndex + 1
MsgBox("Adding Button")
Panel1.Controls.Add(pButton)
MsgBox("Button Added")
End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As

System.EventArgs)
Handles MyBase.Load
Dim mBEReg As New BERegistrySettings
mBEReg.LoadRegistrySettings()
mBECardReaderManager = New BECardReaderManager
mBECardReaderManager.Initialize(mBEReg)
End Sub


Nov 20 '05 #5
Also, is there some way to show a ThreadID or something during execution?
That way maybe i can toss a msgbox command in there to see if I have somehow
gotten onto a different thread...
"Charles Law" <bl***@nowhere.com> wrote in message
news:eL**************@tk2msftngp13.phx.gbl...
Hi

Does your CardInserted event get raised by a different thread?

If so, you will not be able to access the panel in the way you are trying.
Windows control are not thread safe. You can only access them (with a couple of exceptions) on the thread that they were created on. You need to use
Panel1.Invoke in order to pass a delegate to the panel which it can then use for adding the button.

HTH

Charles
"BoloBaby" <bo******@hotmail.com> wrote in message
news:1o********************@comcast.com...
I set up a super-streamlined app with only the essential elements. It's

one
form with a panel control and a button on it.

The stuff in form_load is to get my CardInserted event to fire. When I
insert a smart card, the "Card Inserted" msgbox command goes off, the
"Adding Button" msgbox command goes off, but the "Button Added" msgbox
command does NOT fire. It does fire when the Add sub is called from
Button1_Click.

So *something* is not allowing that panel1.controls.add(pButton) command

to
execute.

The code behind the form looks like this:

Private mintIndex As Integer
Private WithEvents mBECardReaderManager As BECardReaderManager

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
AddButton()
End Sub

Private Sub mBECardReaderManager_BECardInserted(ByVal eCardReaderName As
String, ByVal eCardReaderNumber As Integer, ByVal eCardID As String)

Handles
mBECardReaderManager.BECardInserted
MsgBox("Card Inserted")
AddButton()
End Sub

Private Sub AddButton()
Dim pButton As New Button
pButton.Height = 50
pButton.Width = 100
pButton.Left = (mintIndex Mod 5) * 100
pButton.Top = (mintIndex \ 5) * 50
pButton.Text = "Button #" & mintIndex
mintIndex = mintIndex + 1
MsgBox("Adding Button")
Panel1.Controls.Add(pButton)
MsgBox("Button Added")
End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As

System.EventArgs)
Handles MyBase.Load
Dim mBEReg As New BERegistrySettings
mBEReg.LoadRegistrySettings()
mBECardReaderManager = New BECardReaderManager
mBECardReaderManager.Initialize(mBEReg)
End Sub


Nov 20 '05 #6
If you break at the point where the problem is going to happen, and then, in
the immediate window, type

?Panel1.InvokeRequired

you will discover if the panel was created on the same thread that you are
currently on. If you get True, you will need to use Panel1.Invoke.

Although you appear to be able to access some properties, this does not
automatically mean that things are ok. Accessing controls on different
threads can have odd effects that belie the real problem.

One other thing to try: go to Debug | Exceptions, select Common Language
Runtime Exceptions and then 'Break into the debugger'. Re-run you program in
the debugger, but without breakpoints, and see where it breaks (if it does).
Also, put a Try ... Catch construct round the offending code and see if that
catches an exception.

When an exception occurs in an event handler, it may appear that code stops
executing at a particular line, but all that happens is that the event
handler terminates and the exception is swallowed. Commonly, the error could
be a null reference exception, for example, where you try to access a method
or property of a variable that is nothing.

HTH

Charles
"BoloBaby" <bo******@hotmail.com> wrote in message
news:0Z********************@comcast.com...
Also, is there some way to show a ThreadID or something during execution?
That way maybe i can toss a msgbox command in there to see if I have somehow gotten onto a different thread...
"Charles Law" <bl***@nowhere.com> wrote in message
news:eL**************@tk2msftngp13.phx.gbl...
Hi

Does your CardInserted event get raised by a different thread?

If so, you will not be able to access the panel in the way you are trying. Windows control are not thread safe. You can only access them (with a

couple
of exceptions) on the thread that they were created on. You need to use
Panel1.Invoke in order to pass a delegate to the panel which it can then

use
for adding the button.

HTH

Charles
"BoloBaby" <bo******@hotmail.com> wrote in message
news:1o********************@comcast.com...
I set up a super-streamlined app with only the essential elements. It's
one
form with a panel control and a button on it.

The stuff in form_load is to get my CardInserted event to fire. When
I insert a smart card, the "Card Inserted" msgbox command goes off, the
"Adding Button" msgbox command goes off, but the "Button Added" msgbox
command does NOT fire. It does fire when the Add sub is called from
Button1_Click.

So *something* is not allowing that panel1.controls.add(pButton) command to
execute.

The code behind the form looks like this:

Private mintIndex As Integer
Private WithEvents mBECardReaderManager As BECardReaderManager

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
AddButton()
End Sub

Private Sub mBECardReaderManager_BECardInserted(ByVal eCardReaderName

As String, ByVal eCardReaderNumber As Integer, ByVal eCardID As String)

Handles
mBECardReaderManager.BECardInserted
MsgBox("Card Inserted")
AddButton()
End Sub

Private Sub AddButton()
Dim pButton As New Button
pButton.Height = 50
pButton.Width = 100
pButton.Left = (mintIndex Mod 5) * 100
pButton.Top = (mintIndex \ 5) * 50
pButton.Text = "Button #" & mintIndex
mintIndex = mintIndex + 1
MsgBox("Adding Button")
Panel1.Controls.Add(pButton)
MsgBox("Button Added")
End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As

System.EventArgs)
Handles MyBase.Load
Dim mBEReg As New BERegistrySettings
mBEReg.LoadRegistrySettings()
mBECardReaderManager = New BECardReaderManager
mBECardReaderManager.Initialize(mBEReg)
End Sub



Nov 20 '05 #7
OK - you were right. "? Panel1.InvokeRequired" came up TRUE for when the
CardInserted event was firing. Good call.

Now - not to be a pain - but I'm looking at the documentation for using
Invoke and it isn't making much sense to me. Would it be possible to give
an example of how to get the button added to the panel using Invoke?

....maybe I'm just too tired... heh... been up all night trying to get this
to work...

"Charles Law" <bl***@nowhere.com> wrote in message
news:ex**************@TK2MSFTNGP09.phx.gbl...
If you break at the point where the problem is going to happen, and then, in the immediate window, type

?Panel1.InvokeRequired

you will discover if the panel was created on the same thread that you are
currently on. If you get True, you will need to use Panel1.Invoke.

Although you appear to be able to access some properties, this does not
automatically mean that things are ok. Accessing controls on different
threads can have odd effects that belie the real problem.

One other thing to try: go to Debug | Exceptions, select Common Language
Runtime Exceptions and then 'Break into the debugger'. Re-run you program in the debugger, but without breakpoints, and see where it breaks (if it does). Also, put a Try ... Catch construct round the offending code and see if that catches an exception.

When an exception occurs in an event handler, it may appear that code stops executing at a particular line, but all that happens is that the event
handler terminates and the exception is swallowed. Commonly, the error could be a null reference exception, for example, where you try to access a method or property of a variable that is nothing.

HTH

Charles
"BoloBaby" <bo******@hotmail.com> wrote in message
news:0Z********************@comcast.com...
Also, is there some way to show a ThreadID or something during execution?
That way maybe i can toss a msgbox command in there to see if I have somehow
gotten onto a different thread...
"Charles Law" <bl***@nowhere.com> wrote in message
news:eL**************@tk2msftngp13.phx.gbl...
Hi

Does your CardInserted event get raised by a different thread?

If so, you will not be able to access the panel in the way you are trying. Windows control are not thread safe. You can only access them (with a

couple
of exceptions) on the thread that they were created on. You need to use Panel1.Invoke in order to pass a delegate to the panel which it can then use
for adding the button.

HTH

Charles
"BoloBaby" <bo******@hotmail.com> wrote in message
news:1o********************@comcast.com...
> I set up a super-streamlined app with only the essential elements. It's one
> form with a panel control and a button on it.
>
> The stuff in form_load is to get my CardInserted event to fire.
When I > insert a smart card, the "Card Inserted" msgbox command goes off,
the > "Adding Button" msgbox command goes off, but the "Button Added" msgbox > command does NOT fire. It does fire when the Add sub is called from
> Button1_Click.
>
> So *something* is not allowing that panel1.controls.add(pButton)
command to
> execute.
>
> The code behind the form looks like this:
>
> Private mintIndex As Integer
> Private WithEvents mBECardReaderManager As BECardReaderManager
>
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
> AddButton()
> End Sub
>
> Private Sub mBECardReaderManager_BECardInserted(ByVal
eCardReaderName As > String, ByVal eCardReaderNumber As Integer, ByVal eCardID As String)
Handles
> mBECardReaderManager.BECardInserted
> MsgBox("Card Inserted")
> AddButton()
> End Sub
>
> Private Sub AddButton()
> Dim pButton As New Button
> pButton.Height = 50
> pButton.Width = 100
> pButton.Left = (mintIndex Mod 5) * 100
> pButton.Top = (mintIndex \ 5) * 50
> pButton.Text = "Button #" & mintIndex
> mintIndex = mintIndex + 1
> MsgBox("Adding Button")
> Panel1.Controls.Add(pButton)
> MsgBox("Button Added")
> End Sub
>
> Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
> Handles MyBase.Load
> Dim mBEReg As New BERegistrySettings
> mBEReg.LoadRegistrySettings()
> mBECardReaderManager = New BECardReaderManager
> mBECardReaderManager.Initialize(mBEReg)
> End Sub
>
>



Nov 20 '05 #8
Ooops - I spoke too soon. I have it now. Hopefully you haven't started
typing out a lengthy explanation for me. I have the Invoke working.

Thanks so much for you help!

Gardner
Nov 20 '05 #9
Here is one for updating a progress bar, but it will give you the idea. Call
UpdatePosition from the point where you want the update to occur.

Private Delegate Sub UpdatePositionDelegate(ByVal Value As Int16)

Private Sub UpdatePosition(ByVal Value As Int16)

' This function marshals calls from other threads to the control's
thread
Dim dlgt As UpdatePositionDelegate

' This is used for passing parameters to the handler
Dim args(0) As Object

If ProgressBar1.InvokeRequired Then
' Caller is on a different thread, so we must marshal to the
control's thread
dlgt = New UpdatePositionDelegate(AddressOf UpdatePositionHandler)

args(0) = Value

ProgressBar1.Invoke(dlgt, args)
Else
' Caller is on the same thread, so we can call the update function
directly
UpdatePositionHandler(Value)
End If

End Sub
Private Sub UpdatePositionHandler(ByVal Value As Int16)

' Only update if needs changing
If ProgressBar1.Value <> Value Then
ProgressBar1.Value = Value
End If

End Sub
HTH

Charles
"BoloBaby" <bo******@hotmail.com> wrote in message
news:_t********************@comcast.com...
OK - you were right. "? Panel1.InvokeRequired" came up TRUE for when the
CardInserted event was firing. Good call.

Now - not to be a pain - but I'm looking at the documentation for using
Invoke and it isn't making much sense to me. Would it be possible to give
an example of how to get the button added to the panel using Invoke?

...maybe I'm just too tired... heh... been up all night trying to get this
to work...

"Charles Law" <bl***@nowhere.com> wrote in message
news:ex**************@TK2MSFTNGP09.phx.gbl...
If you break at the point where the problem is going to happen, and then,
in
the immediate window, type

?Panel1.InvokeRequired

you will discover if the panel was created on the same thread that you are currently on. If you get True, you will need to use Panel1.Invoke.

Although you appear to be able to access some properties, this does not
automatically mean that things are ok. Accessing controls on different
threads can have odd effects that belie the real problem.

One other thing to try: go to Debug | Exceptions, select Common Language
Runtime Exceptions and then 'Break into the debugger'. Re-run you
program in
the debugger, but without breakpoints, and see where it breaks (if it

does).
Also, put a Try ... Catch construct round the offending code and see if

that
catches an exception.

When an exception occurs in an event handler, it may appear that code

stops
executing at a particular line, but all that happens is that the event
handler terminates and the exception is swallowed. Commonly, the error

could
be a null reference exception, for example, where you try to access a

method
or property of a variable that is nothing.

HTH

Charles
"BoloBaby" <bo******@hotmail.com> wrote in message
news:0Z********************@comcast.com...
Also, is there some way to show a ThreadID or something during

execution? That way maybe i can toss a msgbox command in there to see if I have

somehow
gotten onto a different thread...
"Charles Law" <bl***@nowhere.com> wrote in message
news:eL**************@tk2msftngp13.phx.gbl...
> Hi
>
> Does your CardInserted event get raised by a different thread?
>
> If so, you will not be able to access the panel in the way you are

trying.
> Windows control are not thread safe. You can only access them (with a couple
> of exceptions) on the thread that they were created on. You need to use > Panel1.Invoke in order to pass a delegate to the panel which it can then use
> for adding the button.
>
> HTH
>
> Charles
>
>
> "BoloBaby" <bo******@hotmail.com> wrote in message
> news:1o********************@comcast.com...
> > I set up a super-streamlined app with only the essential elements.

It's
> one
> > form with a panel control and a button on it.
> >
> > The stuff in form_load is to get my CardInserted event to fire. When
I
> > insert a smart card, the "Card Inserted" msgbox command goes off,

the > > "Adding Button" msgbox command goes off, but the "Button Added" msgbox > > command does NOT fire. It does fire when the Add sub is called from > > Button1_Click.
> >
> > So *something* is not allowing that panel1.controls.add(pButton)

command
> to
> > execute.
> >
> > The code behind the form looks like this:
> >
> > Private mintIndex As Integer
> > Private WithEvents mBECardReaderManager As BECardReaderManager
> >
> > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As > > System.EventArgs) Handles Button1.Click
> > AddButton()
> > End Sub
> >
> > Private Sub mBECardReaderManager_BECardInserted(ByVal

eCardReaderName
As
> > String, ByVal eCardReaderNumber As Integer, ByVal eCardID As String) > Handles
> > mBECardReaderManager.BECardInserted
> > MsgBox("Card Inserted")
> > AddButton()
> > End Sub
> >
> > Private Sub AddButton()
> > Dim pButton As New Button
> > pButton.Height = 50
> > pButton.Width = 100
> > pButton.Left = (mintIndex Mod 5) * 100
> > pButton.Top = (mintIndex \ 5) * 50
> > pButton.Text = "Button #" & mintIndex
> > mintIndex = mintIndex + 1
> > MsgBox("Adding Button")
> > Panel1.Controls.Add(pButton)
> > MsgBox("Button Added")
> > End Sub
> >
> > Private Sub Form1_Load(ByVal sender As Object, ByVal e As
> System.EventArgs)
> > Handles MyBase.Load
> > Dim mBEReg As New BERegistrySettings
> > mBEReg.LoadRegistrySettings()
> > mBECardReaderManager = New BECardReaderManager
> > mBECardReaderManager.Initialize(mBEReg)
> > End Sub
> >
> >
>
>



Nov 20 '05 #10
Hi Bolo,

I was not intrested in your offer, however maybe Charles is?
(Just for fun Charles, I went out fine you took it over)

Cor
Nov 20 '05 #11
"BoloBaby" <bo******@hotmail.com> schrieb
OK, check this out...

I have a form with a panel control and button on it (outside the
panel control).


Referring to both of your threads: When your app hangs, did you try pressing
Ctrl+Break and have a look at the callstack to see where?
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #12

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

Similar topics

1
by: Anand Ganesh | last post by:
Hi All, I am trying to draw a picture in a panel control. It is drawing up correctly. When the picture size is greater than the panel control, I am expecting horizontal and vertical scroll...
2
by: KatB | last post by:
Hi, Am I missing something re: the panel control? I finally have a use for it, but when I put other controls into it, they squish up (yes, technical term!), and I can not move them into other...
4
by: Alexandre Soares | last post by:
Hi, If I make a control that derives from panel, how can I persist the state of the controls that are inside the panel when it is not rendered (visible = false)? The reason for this is that...
7
by: Mike Stephens | last post by:
How can I make a usercontrol host other controls, such as the Groupbox and Panel.
0
by: Larry Charlton | last post by:
Is there a way to make a Panel (or other control that can contain child controls) so that it will size correctly at design time (based on CSS)? Panel seems to be doing something weird at design...
1
by: TheSteph | last post by:
Hi ! I would like to create a UserControl that act as a « Collapsible Panel ». So I have a UserControl with two panels : a "Header panel" at the top, and a "Container Area Panel"...
4
by: tshad | last post by:
I am trying to hide and show certain parts of my code (which I have no problem doing with DW). In VS 2003, it won't let you use <div runat="server"to section of parts of my code in a table. This...
1
by: Frank Burleigh | last post by:
A while ago I installed Net 2.0 to our Server 2003 web machine, but the Control Panel folder icon for configuring Net 2.0 never made it to the Control Panel folder. Thinking this might indicate a...
2
by: DM | last post by:
Hi All, I'm having trouble accessing the ClientRectangle property on a panel control. At design-time it says that ClientRectangle is not a member of the Panel class, but when I look at the...
1
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: 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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.