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

Add subform to a form?

Can a vb.net form contain a subform? If yes, how is this done?

Maybe I am going about my issue the wrong way. I start an asynchronous
procedure from my main form - invoke a routine on a mainframe computer. Then
I am polling every 10 seconds (timer1) to see if the external program has
generated a data result set for my form to retrieve. In the meantime, on the
same main form I have a series a little labels that blink on/off in a series
for visual status that the program is polling (using a separate timer -
timer2). Well, everytime the program polls - the labels halt their blinking
for a few seconds. I want the labels to keep blinking during the polling. I
tried running timer2 in a separate thread object but that did not work - as I
could not turn timer2 on in the separate thread. So I am thinking to place
the labels in a subform with its own timer that is always running and I can
set a boolean var to turn the labels on and off when the polling stops. So,
is there a way to place a subform on a main form? Or -- how can I set
timer2.Enabled = True in a separate thread on the same form? I thought
timers were on their own threads.

Thanks
Nov 21 '05 #1
2 2046
Why not turn the blink ON (ie: load an embedded resource bitmap or such the
like into a Picturebox control) at the moment you are about to poll. This
blink image will stay on-screen while polling. In fact, it can't disappear,
because it was there prior to the polling, and the polling function has no
way of knowing how to eradicate it from the screen. As soon as the polling
function is complete load a different embedded resource bitmap to indicate
that the polling function is now complete. Voila! Works perfectly. Isn't
this what you're trying to do anyway? (ie: let the user know that polling is
taking place?). If you really want to show the user that the poll is in
progress then your status light should stay ON (ie: visible on the screen)
for the entire time that polling occurs. I do this kind of thing all the
time, but then maybe I'm not understanding exactly what you're doing.

Caution: When you load an embedded resource into a bitmap object via a
stream, and then plunk it into a Picturebox control, the PictureBox control
will reflect the change on-screen almost all the time. But it will not
reflect the change when your application is in the midst of creating a new
form. Therefore, to ensure that the PictureBox control always shows the
correct status light image use "MyPictureBox.Refresh()" immediately after
setting the image.

Also, I've developed clsStatusLight as an object that represents a blinking
status light (RED, GREEN, or YELLOW, with WHITE for "off"). For example, RED
usually denotes a write-access, GREEN usually denotes a read-access, and
yellow usually denotes an error of some kind. This object creates a state
timer on the fly to accomplish nice blinking. Furthermore, you can try to
blink as rapidly as you want but clsStatusLight ensures that a blink-request
during a blink-in-progress is deemed to be the same blink, and therefore
generates no additional load on the system. If you want a copy let me know.

Also, explain in a little more detail if I'm not understanding your
situation.

Thanks,

Tom Edelbrok


"Rich" <Ri**@discussions.microsoft.com> wrote in message
news:6E**********************************@microsof t.com...
Can a vb.net form contain a subform? If yes, how is this done?

Maybe I am going about my issue the wrong way. I start an asynchronous
procedure from my main form - invoke a routine on a mainframe computer.
Then
I am polling every 10 seconds (timer1) to see if the external program has
generated a data result set for my form to retrieve. In the meantime, on
the
same main form I have a series a little labels that blink on/off in a
series
for visual status that the program is polling (using a separate timer -
timer2). Well, everytime the program polls - the labels halt their
blinking
for a few seconds. I want the labels to keep blinking during the polling.
I
tried running timer2 in a separate thread object but that did not work -
as I
could not turn timer2 on in the separate thread. So I am thinking to
place
the labels in a subform with its own timer that is always running and I
can
set a boolean var to turn the labels on and off when the polling stops.
So,
is there a way to place a subform on a main form? Or -- how can I set
timer2.Enabled = True in a separate thread on the same form? I thought
timers were on their own threads.

Thanks

Nov 21 '05 #2
Thanks for your reply. Actually, what I have is 20 little label squares
(rectangles)

*â–ˆ *â–ˆ*â–ˆ*â–ˆ*â–ˆ*â–ˆ*â–ˆ*â–ˆ*█†®â–ˆ*â–ˆ*â–ˆ*â–ˆ*â–ˆ*â–ˆ*â–ˆ*â–ˆ*â –ˆ*â–ˆ*â–ˆ

They are all light yellow when polling starts then lbl0 turns blue for 100ms
then lbl1 turns blue while the rest go back to light yellow, then lbl2 turns
blue, lbl3 turns blue, etc from timer2. Maybe this is a little bit too cute,
but it keeps the end users from thinking that the program is not working or
is locked up or something. When polling is finished and the file is
retrieved, these labels disappear. My problem is that every 10 seconds (on
timer1) the labels halt the color changing. Each poll takes about 5 seconds.
This gives the illusion that a file is being picked up, when in fact, this
is not the case. The mainframe proc takes about 5-10 minutes to run. Thus,
I am thinking a subform. Any ideas appreciated how to make my visual status
indicator function correctly.

Thanks
**


"Tom Edelbrok" wrote:
Why not turn the blink ON (ie: load an embedded resource bitmap or such the
like into a Picturebox control) at the moment you are about to poll. This
blink image will stay on-screen while polling. In fact, it can't disappear,
because it was there prior to the polling, and the polling function has no
way of knowing how to eradicate it from the screen. As soon as the polling
function is complete load a different embedded resource bitmap to indicate
that the polling function is now complete. Voila! Works perfectly. Isn't
this what you're trying to do anyway? (ie: let the user know that polling is
taking place?). If you really want to show the user that the poll is in
progress then your status light should stay ON (ie: visible on the screen)
for the entire time that polling occurs. I do this kind of thing all the
time, but then maybe I'm not understanding exactly what you're doing.

Caution: When you load an embedded resource into a bitmap object via a
stream, and then plunk it into a Picturebox control, the PictureBox control
will reflect the change on-screen almost all the time. But it will not
reflect the change when your application is in the midst of creating a new
form. Therefore, to ensure that the PictureBox control always shows the
correct status light image use "MyPictureBox.Refresh()" immediately after
setting the image.

Also, I've developed clsStatusLight as an object that represents a blinking
status light (RED, GREEN, or YELLOW, with WHITE for "off"). For example, RED
usually denotes a write-access, GREEN usually denotes a read-access, and
yellow usually denotes an error of some kind. This object creates a state
timer on the fly to accomplish nice blinking. Furthermore, you can try to
blink as rapidly as you want but clsStatusLight ensures that a blink-request
during a blink-in-progress is deemed to be the same blink, and therefore
generates no additional load on the system. If you want a copy let me know.

Also, explain in a little more detail if I'm not understanding your
situation.

Thanks,

Tom Edelbrok


"Rich" <Ri**@discussions.microsoft.com> wrote in message
news:6E**********************************@microsof t.com...
Can a vb.net form contain a subform? If yes, how is this done?

Maybe I am going about my issue the wrong way. I start an asynchronous
procedure from my main form - invoke a routine on a mainframe computer.
Then
I am polling every 10 seconds (timer1) to see if the external program has
generated a data result set for my form to retrieve. In the meantime, on
the
same main form I have a series a little labels that blink on/off in a
series
for visual status that the program is polling (using a separate timer -
timer2). Well, everytime the program polls - the labels halt their
blinking
for a few seconds. I want the labels to keep blinking during the polling.
I
tried running timer2 in a separate thread object but that did not work -
as I
could not turn timer2 on in the separate thread. So I am thinking to
place
the labels in a subform with its own timer that is always running and I
can
set a boolean var to turn the labels on and off when the polling stops.
So,
is there a way to place a subform on a main form? Or -- how can I set
timer2.Enabled = True in a separate thread on the same form? I thought
timers were on their own threads.

Thanks


Nov 21 '05 #3

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

Similar topics

15
by: Rey | last post by:
Howdy all. Appreciate your help with several problems I'm having: I'm trying to determine if the Visit subform (subformVisits) has a new record or been changed, i.e. dirty. The form that...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
12
by: MLH | last post by:
I have created two forms: frmBrowseNegsMainform and frmBrowseNegsSubform. I put a subform control on the first of these. The SourceObject property for the subform control is, of course,...
1
by: John Michael | last post by:
I have a form that has a subform that has a subform. The subform loads a record based on a combo lookup box in the main form. I'm trying to set a value in the subform based on a value in a...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
6
by: DMUM via AccessMonster.com | last post by:
Hello I am trying to pass the name of my subform to a function/sub but I can't seem to get it to work. I am using an autokey function (ctrl E) to unlock text boxes on a subform. I have a few...
4
by: Macbane | last post by:
Hi, I have a 'main' form called frmIssues which has a subform control (named linkIssuesDrug) containing the subform sfrmLink_Issues_Drugs. A control button on the main form opens a pop-up form...
7
by: ApexData | last post by:
I am using the following code in my TabControl to manage subform loads. The code assigns the subForms SourceObject. - Do I also need code to DeAssign the SourceObject when leaving the Tab, I'm...
11
by: mrowe | last post by:
I am using Access 2003. (I am also using ADO in the vast majority of my code. I recently read a post that indicated that ADO is not all that is was initially cracked up to be. In the back of my...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.