473,398 Members | 2,525 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,398 software developers and data experts.

access a form a class that the form has called

Hi...

I have a windows form that calls/uses a class to do some processing. I
want this class to return values or append text to the form's textbox as
it processes data. Any of you guys know how I could do this?

I was already able to do this before but unfortunately, my code has been
deleted and I can't reconstruct it.

Thank you very very much... :D

Cath

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #1
4 1405
Cor
Hi Cath,

You are a very lucky guy (or girl)

The group had some fun and Armin got a challenge, he did contribute it about an hour ago, it is in this group. It even goes with a picture, you have to make it yourself with text.

I did copy it for you (and tested it) it is only a sample

\\\q&d needs a panel on a form
Private m_StartTicks As Integer = Environment.TickCount
Private m_Bmp As New Bitmap( _
"G:\enterthepathwherethebitmapcanbefound\Bitmap1.b mp" _
)

Private Sub Timer1_Tick( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Timer1.Tick

UpdatePanel()
End Sub

Private Sub UpdatePanel()
Dim Diff As Integer
Dim g As Graphics
Diff = Environment.TickCount - m_StartTicks
g = Me.Panel1.CreateGraphics
g.DrawImage( _
m_Bmp, 0, 0, _
New Rectangle( _
0, Diff \ 20, Me.Panel1.Width, Me.Panel1.Height _
), GraphicsUnit.Pixel _
)
g.Dispose
'TODO: watch exceeding the bitmap's height and
'implement a loop
End Sub

Private Sub Panel1_Paint( _
ByVal sender As Object, _
ByVal e As System.Windows.Forms.PaintEventArgs) _
Handles Panel1.Paint

UpdatePanel()
End Sub

and: timer1.interval=100
If you want it *really* smooth it occupies some more cpu power: (also q&d)

Shared Sub main()
'I never use "Call", but "(New Form1).ShowDialog"
'does not work
Call (New Form1).ShowDialog()
End Sub

Public Shadows Sub ShowDialog()

Dim rect As Rectangle
Dim StartTicks As Integer

Me.Show()
Me.Refresh()

rect.Width = Me.Panel1.Width
rect.Height = Me.Panel1.Height

StartTicks = Environment.TickCount

Do
Dim Diff, Y As Integer
Dim g As Graphics
Diff = Environment.TickCount - StartTicks
rect.Y = Diff \ 20
'TODO: same todo as above...
g = Panel1.CreateGraphics
g.DrawImage(m_Bmp, 0, 0, rect, GraphicsUnit.Pixel)
g.Dispose()
Application.DoEvents()
Loop While Me.Created

End Sub
I hope this helps a little bit?

(compliments to Armin)

Cor
Nov 20 '05 #2
"Cor" <no*@non.com> schrieb
(compliments to Armin)


Aaahh, no, it's q&d (and declared as q&d).

:-)
--
Armin

Nov 20 '05 #3
"Cath Victor" <ca**@cathyvictor.com> schrieb

I have a windows form that calls/uses a class to do some processing.
I want this class to return values or append text to the form's
textbox as it processes data. Any of you guys know how I could do
this?

I was already able to do this before but unfortunately, my code has
been deleted and I can't reconstruct it.


In the class, raise an event. In the Form, handle the event and update the
display. It you don't need to use the Form during the process, it is
sufficient to call the Refresh method of the controls that need to be
refreshed.

ATTENTION: Using WinXP, calling the Refresh method does not refresh the
control after a couple of seconds. Reason: (3rd paragraph)
http://msdn.microsoft.com/library/en...sagequeues.asp

This annoying "feature" can not be turned off (AFAIK)! There is no way to
update the display only. Either you have to use Application.Doevents (which
also enables the user to interact with the Form - what you might not want),
or you have to do the job in a new thread.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #4
* Cath Victor <ca**@cathyvictor.com> scripsit:
I have a windows form that calls/uses a class to do some processing. I
want this class to return values or append text to the form's textbox as
it processes data. Any of you guys know how I could do this?

I was already able to do this before but unfortunately, my code has been
deleted and I can't reconstruct it.


See:

<http://groups.google.com/groups?selm=uh87DfymDHA.3504%40TK2MSFTNGP11.phx.gb l>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5

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

Similar topics

10
by: tom | last post by:
Hey All, While running some code, I'd like to open a form as a dialog box (so that the code will wait for the form to be closed/hidden -- easy to do using the acDialog argument), but I would...
7
by: James Fortune | last post by:
In response to different users or situations (data context) I transform the appearance and characteristics of Access Forms through code. This seems to fit in with the idea of polymorphism. Do...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
9
by: MacDermott | last post by:
I have an Access MDB which instantiates a class in a custom DLL, manipulates it for a while, then sets it equal nothing. The MDB does other things,too, and generally behaves itself as desired....
55
by: AnandaSim | last post by:
I just had a google through this NG but have not seen mention of Erik Rucker's blog entry and the new Jet: http://blogs.msdn.com/access/archive/2005/10/05/477549.aspx mentioned by Mike...
4
by: Al Murphy | last post by:
I have a windows application called "WindowsApplication1". I have a variable of tyoe DataSet called myDataSet as shown below: namespace WindowsApplication1 { public class Form1 :...
5
by: Lyle Fairfield | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/callnetfrcom.asp The Joy of Interoperability Sometimes a revolution in programming forces you to abandon all...
1
by: DoctorV3774 | last post by:
We developed a small test database that we are using to attempt to connect to a wsdl to consume web services. The database form contains 3 fields and a submit button on the form. At the bottom I've...
3
by: Peted | last post by:
Hi i hope i explaine this correctly I have a class with a method that reads and writes using blocking sockets to a TCP device. Call it class IPdevice. I can use this method to send commands and...
1
by: jsd219 | last post by:
I have a fairly simple login in script and I need to make it have two levels of access not one. can anyone help me with this? The script is below: <?php // we must never forget to start the...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...

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.