473,789 Members | 2,683 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Windows Form Interaction

I have a parent form and a child form. Both contain a textbox. Child also
has a button.

I want to open child with the following:

Dim mfrmFind As New frmFind
Private Sub OpenForm
AddHandler mfrmFind.Closin g, AddressOf frmFindClosing
mfrmFind.TopMos t = True
mfrmFind.Show()
End Sub

When I click the button on the child form, I want the text in the child
textbox to be written in the textbox of parent. I can't find a way to do
this. Any ideas?

I want child form to remain open and on top of parent form during this
process.

Nov 21 '05 #1
1 1191

Jan. 12, 2005

What you need to do is pass the instance of the parent form to the
child form. You can do this by modifying the child's constructor. Try:

Public class frmFind
dim frmparent as ParentFormName
public sub new(byref parent as ParentFormName) 'add parameter
frmparent = parent
end sub

'Assumes textbox on parent and child is txtParent and txtChild

private sub Button1_Click(. ..)
frmparent.txtpa rent.text = txtchild.text
end sub
end class
-----------------------
Dim mfrmFind As New frmFind(Me) 'Pass instance of parent form
Private Sub OpenForm
AddHandler mfrmFind.Closin g, AddressOf frmFindClosing
mfrmFind.TopMos t = True
mfrmFind.Show()
End Sub

I hope this makes sense and good night! :)
Joseph MCAD
"genojoe" wrote:
I have a parent form and a child form. Both contain a textbox. Child also
has a button.

I want to open child with the following:

Dim mfrmFind As New frmFind
Private Sub OpenForm
AddHandler mfrmFind.Closin g, AddressOf frmFindClosing
mfrmFind.TopMos t = True
mfrmFind.Show()
End Sub

When I click the button on the child form, I want the text in the child
textbox to be written in the textbox of parent. I can't find a way to do
this. Any ideas?

I want child form to remain open and on top of parent form during this
process.

Nov 21 '05 #2

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

Similar topics

0
2314
by: Tim Haughton | last post by:
I've just released an article on using Test Driven Development with C# and Windows Forms. GUI's are often difficult to test, so I thought it might be of interest. The article along with the example source code can be downloaded here: http://www.blogitek.com/timhaughton/archives/files/User%20Interrogator%20And%20TDD.zip The article text is below. Not sure what it will do to the formatting when
1
5690
by: Artur Kowalski | last post by:
I have a NotifyIcon in my Windows Service project and I am trying to add a ContextMenu to this NotifyIcon or use some of the mouse events. Everything isn't working. I think so base class of the service System.ServiceProcess.ServiceBase don't catchWindows messages like mouse or timer messages. Any Idea? Thanks,
1
1693
by: Robert May | last post by:
I have an application that uses the Ax web browser object. When I call the IHTMLElement.click() method on an input button (<input type="submit"> or <input type="button">), the click fires appropriately, if I'm running it from a windows forms based application. However, when I run the EXACT same code under a windows service, either as a logged in user or as the local system account, the click fails to process. Clicking on other elements...
1
2260
by: Tomas Vera | last post by:
Hello All, I'm working on a web app that will simulate a Windows app. One of the items that I've trouble reproducing is the parent/child interaction that might occur between a windo and popup custom dialog box (example: right click an item and bring up a Config/Properties dialog of the selected item). In a Windows app, I can add a handler in the Parent to respond to the "OK" event in the child window so that I can update the object's
1
2090
by: manuel.ricca | last post by:
Hello, I'm just starting to code a windows service in C#. My service needs to create multiple threads, each one responding to TAPI events. Then I will need to have a client connect to it for administration. Finally, an icon in the system tray would be nice. Can anyone tell me more or less how to do this? Is there some sample from where I can take the basic "structure" of the application?
13
1505
by: Samuel R. Neff | last post by:
I want to make my app repaint and show a wait cursor during a long running process but not actually respond to user events. What's the best way to implement this? If I just put the process on another thread, the user can continue to interact with the form. For my own code, I can have a flag in all event handlers, but what about interaction within a control (i.e., expand/collapse tree nodes in treeview). If I change the Enabled...
3
14357
by: Vitaly Zayko | last post by:
Is it possible to attach a form (C# .NET 2) to windows service and show it in OnStart event? When I tried to do this in general (new, Show()) way it just didn't do anything nor gave me any errors. I want to use this form for interaction with the service. Thanks! Vit Zayko
2
6902
by: deko | last post by:
When to use a privileged user thread rather than a windows service? That's the question raised in a previous post . It was suggested that if the service needs to interact with a WinForms app (which is the UI used to adjust the actions taken by, and the schedule of the service), then a privileged user thread should be used in the UI - no service required. But... "A windows service enables the creation of long-running executable
5
4263
by: sonali_reddy123 | last post by:
Hello all, I am trying to develop an application which will run as a windows service. The application should have Normal options available with service like start, stop and pause but along with this I need an option to show the windows application which my service has started as a result of its invokation. So I have written a service control by adding a new project of type
1
5142
by: trinityofsouls | last post by:
I am trying to run a windows application from a service. Both the Windows Form App and the Windows Service were created using the .NET 2005 "New Project" Templates. There service is working as intended (It picks up files to be proccessed out of watch directories) however there seems to be an issue when the Windows App is called. I use the below to call the application: ProcessStartInfo theProcess; theProcess = new...
0
9666
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10408
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10199
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9020
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3700
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.