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

Interact with components from other forms

80 64KB
This may seem a bit dumb, but I've never learnt this at college and I can't find any tutorials or examples.

what I'm doing is giving the user the choice to show 2 different dates. 1 in yyyy-mm-dd notation and the other in dd-mm-yyyy notation.

I'm using a second form to do this.
So from Form1 I have my data in the datagrid and in Form2 I have 2 radio buttons giving the user the choice between Date1 and Date2. So how would I be able to interact with the first form with the radio buttons?
May 6 '13 #1
10 1456
vijay6
158 100+
Hey M1kkelZU, is you invoking 'Form2' from 'Form1'?
May 6 '13 #2
M1kkelZU
80 64KB
What do you mean with Invoking form2 from form1?

Sorry, I'm still in college so most of this wont make sense to me yet. My professors aren't exactly the best nowadays.
May 6 '13 #3
vijay6
158 100+
Hey M1kkelZU, you said you're showing two different forms 'Form1' and 'Form2'. Is you taking object for 'Form2' and showing it inside of 'Form1'?
May 6 '13 #4
M1kkelZU
80 64KB
Well What I'm doing is just giving an option to change the view of a column in the datagridview.
The Datagridview is in Form1 and the options are in Form2.
May 6 '13 #5
vijay6
158 100+
Hey M1kkelZU, change the Access Modifiers of the 'radio button 1' and 'radio button 2' to public (so that you can access them from outside of 'Form2') inside 'Form2'. And in 'Form1' create the CheckedChanged event for the both radio buttons after taking the object to 'Form2' and before calling the 'Show' method. And inside the CheckedChanged event of 'radio button 1' check 'radio button 1' is checked or not. If checked means do the necessary changes to your data-grid-view. Do the same thing also for 'radio button 2'.
May 6 '13 #6
M1kkelZU
80 64KB
Well I have to interact with the datagridview through the radio buttons, so how would I change the accessmodifier of the data grid?
May 6 '13 #7
vijay6
158 100+
Hey M1kkelZU, for your question "So from Form1 I have my data in the datagrid and in Form2 I have 2 radio buttons giving the user the choice between Date1 and Date2. So how would I be able to interact with the first form with the radio buttons?" there is no need to change the access modifier of the data-grid-view.
May 6 '13 #8
M1kkelZU
80 64KB
Ah ok, so if I change the modifier from private to public I should be able to change the way a column is shown. If thats too much work I'll just add the radio buttons to the original form to save time.
May 6 '13 #9
vijay6
158 100+
If thats too much work I'll just add the radio buttons to the original form to save time.
Hey M1kkelZU, Your wish.
May 6 '13 #10
M1kkelZU
80 64KB
I do want to try and get this working as it will make the main form look less cluttered. Thanks for the help vijay6 :)
May 6 '13 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Andrew Wrigley | last post by:
Hi Should a hidden form become visible when all other forms are closed? This is what happens, and to ensure that it is always hidden, I have to set the on got focus event handler of the form...
21
by: Mark Rae | last post by:
Hi, Apologies if this is a stupid question - I'm a C# newbie... :-) I have a Windows app with two form: frmConfigReg and frmNewApp. frmConfigReg is the startup form. It has several controls,...
1
by: Dan | last post by:
Is it possible to access controls on other forms when using managed C++? In VB, it was a simple matter of declaring the form as global, but this is apperently not possible when using managed code....
4
by: Robin Tucker | last post by:
How can I make my form stay on top of all the other forms in my application? I don't want the form to stay on top in Windows as a whole, just be on top of all the other forms in the given...
5
by: Simon Verona | last post by:
I have an application with a menu system which creates a new thread when a menu item is selected - some of these other threads may open a form for user interaction. Before the menu system is...
4
by: fniles | last post by:
I have an ActiveX control in my web page that I tried to access using intranet. I have implemented IObjectSafety in the ActiveX control, and when I created the CAB file using VB Pakage and...
2
by: doncee | last post by:
I thought that you could take a value created in a text box of one form & make it available for use by other forms in the same database as until you closed that database. If this is possible...
8
by: sebouh181 | last post by:
I am writing to registry using javascript. var wsh = new ActiveXObject("WScript.Shell"); var key = "HKLM\\Software\\Neos\\2.0\\LightMode\\my-script"; wsh.RegWrite (key, 1999, "REG_SZ"); when i...
2
by: gumdealer328 | last post by:
I have multiple forms and in the 2nd form i access some variables and get there values which are added up by the function in the cost class. when i put "Dim TotalCost as New Cost" does that...
10
by: =?Utf-8?B?MjJQb20=?= | last post by:
Hi All, Thanks to Family Tree Mike I've managed to get a Solution up and running, now comes the fun part. How do I call forms from other Class Libraries and how do I use a Background form...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...

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.