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

accessing control from a windowsform through a class file

hi all,
I have some unsolving issue. i.e accessing a windowform listview in
a classfile. I want access the listview control which is placed in a window
form , with full features. Can any body helps.
Thank you.

Regards,
Kamal.
Mar 12 '07 #1
1 1336
Which class? The form is a class... in which case you can access it
(usually) via the private field.

Outside of that scenario, I don't often advise toying with a control
outside of its parent; it usually means you are doing things in a
counter-intuitive way. I'd simply have properties / methods on the
form / control that let me get (indirect) access to the listview.
Exposing it more directly breaks a few OO ideals about encapsulation
etc.

If you *must* do it, then either make the field (eugh; slightly
better: property) public, or search by name using the Controls
collection (and Find).

Can I ask what you are trying to do? There may be a better way...

Marc
Mar 12 '07 #2

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

Similar topics

3
by: Vivek Sharma | last post by:
Hi, I have created a dropdownlist as a web user control. I am using its multiple instances on the webpage. How do I access the selectedValue of each instance? All the instances have different...
1
by: Jeff Smith | last post by:
Can I load custom web user controls dynamically and access the properties and methods without having to explicitly define custom control types (example 2 below). I have custom web control named...
5
by: Daniel Corbett | last post by:
I am trying to save a file dynamically created in a webpage. I get the following headers, but cannot figure out how to save the attachment. I am basically trying to replicate what internet...
6
by: Adrian | last post by:
Hi I'm building an ActiveX replacement in VB.net base info from http://www.vbdotnetheaven.com/Code/Jun2003/2067.asp Anyone know how I can call a JavaScript Function in the hosting webpage from...
0
by: Vignesh | last post by:
Iam Having 3 separate VB.NET Windows projects (MainProject, Project1, Project2). From MainProject iam calling Project1 & Projct2. Project1 contains a user control.Project2 also contains a User...
1
by: MultiMarine | last post by:
Hello I have just started using .NET and C# from a c++ background using win32. Now i want to do something that i used to do, without using the win32 API. I use Spy++ to get a HWND from...
5
by: Siva | last post by:
Hello I have a dropdownlist inside the gridview as a template column defined as follows: <asp:TemplateField HeaderText="Choose Location"> <ItemTemplate> <asp:DropDownList ID="ddlChooseLoc"...
3
by: Jeff | last post by:
Hey asp.net 2.0 In the source I posted below, there is a GridView (look at the bottom of the script): <asp:GridView ID="gvwOnline" runat="server"> </asp:GridView> I'm trying to assign a...
9
by: J055 | last post by:
Hi I have a standard asp page which uses a MasterPage. The MasterPage contains a User control. How can I access a public method in the User control from my WebForm page? I can't move the method...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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: 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
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...

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.