Pass A Listbox Selecteditem In Usercontrol To Parent Form?

Oct 19, 2010

I have a user control which contains several buttons and a listbox. Clicking a buttondetermines what items are in the listbox. When a user clicks an item in the listbox I want the selecteditem passed to the parent form.

View 6 Replies


ADVERTISEMENT

VB Calling Parent Form Methods In A Usercontrol

Sep 29, 2010

control that contains a button. the user control is placed on my main form. when the button on the user control is clicked I need to to call a method that is located in the mainform.vb

View 2 Replies

VB Calling Parent Form's Methods In A Usercontrol?

Aug 9, 2009

control that contains a button. the user control is placed on my main form. when the button on the user control is clicked I need to to call a method that is located in the

View 9 Replies

Pass Listbox Index To Another Listbox To Insert Value Via Inputbox Or Another Form?

Sep 20, 2011

what it does iswhen a user checks an item in the checked list box it transfer it to a listboxso i have a checked list box and a listboxi am planning to put another listboxwhat i would like to be able to do is thatwhen the user checks an item on the checked list box it will transfer the item into the listbox [like the one on my previous thread]and be able to show an messagebox with a textbox [ i read its called an input box ] or another form with a textbox and/or combo box will pop up

View 13 Replies

Listbox.SelectedItem - Populate A Listbox With Data In The Code?

Apr 12, 2012

I have a listbox and i populate it with data in my code like this on the page load....

[code]...

So say one item in the list is displayed Ted Jones (123) and its valuefield should be 123. Im just not understanding what i am doing wrong here.

View 5 Replies

Listbox SelectedItem Not Working

Oct 25, 2006

I have a function that fills a listbox with data from sql server 2000 database. Here is the code: (It's in a class)

[Code]...

View 9 Replies

Listbox SelectedItem When Using Datasource?

Sep 29, 2009

Ok I have a Listbox that is populated by a Datasource or the datasource is a listbox. When I try and retrieve the selected item It is blank. How do I retrieve the selectedItem?

View 9 Replies

Pass Usercontrol Controls Or Form Controls?

May 11, 2009

I created a class that can take either usercontrol.controls or form.controls as a parameter,how can i pass either to that class? as a property or how?

View 4 Replies

Save The Selecteditem Not Whole Listbox Item?

Mar 15, 2012

[Code]...

when u select s1 then u click save it so the txt file will have items s1 only and when u select s2 and click the save button then in txt file u have 2 items

View 3 Replies

Show A Panel At Each Selecteditem From Listbox

Feb 29, 2012

form1 it have a panel1 with 3 buttons in it.what i want is when you click each item in list then panel1 popup and shows up near that item.[code]

View 2 Replies

Transparent SelectedItem :: ListBox, CheckedListBox, Etc?

Jan 27, 2009

I am building a WinForms application. On one user control I have a CheckedListBox on the left and a ListBox on the right. Within both controls, the selected item(s) become completely transparent. Not only transparent, but if I was to click within the transparent area(s), I would actually be clicking whatever is underneath the application. So, if the WinForms app is loaded up and sitting on top of a browser, when I click one of the items within either list control, I could actually click a link within the browser underneath. At first I thought that I had changed a setting of each control. I thought there might be something like SelectedItemTransparent = True/False, but upon further looking, I think it might be an application-wide setting. I have confirmed that it isn't just this one machine. I have loaded the project into VS 2008 on both my laptop and desktop with the exact same results.

View 2 Replies

Treat SelectedItem In Listbox As Certain Object?

Feb 23, 2010

I'm using a listbox to list my custom objects. I need to use the ListboxSelected event and treat the SelectedItem as MyObject, so I can get certain properties from it... How do I do this?

View 1 Replies

Listbox Selecteditem Error - Object Reference Not Set

Jan 28, 2010

There have an error:

"Object Reference not set to an instance of an object"

when using objusername.intuserid=listbox1.selecteditem.value.

View 1 Replies

Asp.net - How To Pass An ID From Parent ListView To A Child Repeater Inside The Parent ListView

Oct 12, 2011

I have a listview "CategoriesList" and i have a repeater "NewsRepeater" inside the listview "CategoriesList"

<asp:ListView ID="CategoriesList" runat="server" DataKeyNames="CatID" DataSourceID="CategoriesListODS"
EnableModelValidation="True">

[Code]....

how to pass the catID from the listview and make it as SelectParameters in ObjectDataSource "NewsRepeaterODS"?

View 1 Replies

MDI Child Maximized - The Child Form Shows Maximized In The MDI Parent But Behind The UserControl

Nov 12, 2010

Note: I am working with Visual Studio 2010 Professional. Note: There are a lot of MDI Child posts, but none (that I have found) that apply to my scenario... Scenario I have an MDI form with a UserControl docked at the top. The UserControl is for navigation and is ~50 pixels in height. When I show a child form with its WindowState property already set to 'Maximized', the child form shows maximized in the MDI parent, but behind the UserControl.

[Code]...

View 3 Replies

Asp.net - Pass An Object Into A UserControl In A Repeater?

Jul 24, 2009

I want to wrap up a chunk of HTML render logic in a User Control. Then I want to pass a custom product object (title, thumbnail, id, etc.) to the UserControl that it can use when it renders. Ideally I want to use this in a repeater (or for loop) and pass the current custom product object into the UC.Every example I've seen has been passing through strings on the UC tag but thats not really want I want to do as it means I'll have references everywhere that need updating should we add a new field that needs rendering.

.Net 1 using VB.net (not my first choice for .net so go easy)HTML example to get us going, this would be in the .ascx page:

<div>
<h3><%= myProd.title %></h3>
<img src="<%= myProd.thumbnail %>" />
<p>

[code]....

Yet in my ascs page I get:"Object reference not set to an instance of an object"

Line 1: <%@ Control Language="vb" AutoEventWireup="false" Codebehind="ProductRender.ascx.vb" Inherits="MyApp.ProductRender" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
Line 2: <h3>
Line 3: <%= myProd.title %>
Line 4: </h3>

View 2 Replies

Forms :: Pass UserControl As An Argument?

Sep 8, 2010

I've got several user controls and every time I add them, I post this

Dim uc As New ucTemplates ' 'ucTemplates' is the name of the actual user contrll
gbControls.Controls.Clear()
gbControls.Controls.Add(uc)

So, I'd like to create a sub that does the same thing, passing the usercontrol as an argument

Private Sub AddUC(myControl as UserControl)
gbControls.Controls.Clear()
gbControls.Controls.Add(myControl)
End Sub

But - when I try:
addUC(ucTemplates)

I get an error that ucTemplates is a type and cannot be used as an expression
I can get it working if I add the Dim uc As New before the addUC - but I'd rather have it so I only repeat one line, not 2

View 1 Replies

Pass Data From View To UserControl In ASP.NET MVC?

Mar 24, 2010

Say I want to do the simplest of the data passing as follows [code]...

What I want to do is to pass the variable i as the parameter to the UserControl so that it displays the number inside a, say, bordered div.

View 2 Replies

.net - RaiseEvent From A UserControl That's Placed On A UserControl That's On A Form?

Jul 11, 2011

I have a Windows Form that contains a custom control container as a UserControl. For the sake of this question, this custom control container is called Dashboard. This container called Dashboard contains numerous other controls depending on their permissions. I need to raise events that are contained on these controls through the Dashboard control and over to the Windows Form.

How can I bubble up the event? I'm using VB.NET for this project, but can convert C# into VB.NET.Also, to complicate matters, the main Windows Form is a VB6 project. So, I'm using the InteropFormsToolkit to accomplish this.

View 1 Replies

Calling A Sub And Pass In Parent Object?

Jul 6, 2009

I have a statement that will call a Sub.

Charts(CurChartNo) = Server.CreateObject("ChartFX.WebServer")
Call InitChart()

Inside this sub, I will assign values to the properties of the Charts object that is

Public Sub InitChart()
Charts(CurChartNo).RGB2Dbk = &HC0FFFF&
Charts(CurChartNo).Chart3D = False

[code]....

But the Charts is not recognized in the Sub. This is current program under ASP, I am converting to ASP.Net.

View 3 Replies

Pass Datagrid Values To Parent Window?

Oct 20, 2009

i've small problem in vb.net .i've mdi container form,in child form datagridview is there previoues,next buttons in parent form.

How to pass datagrid values to parent window?

i'm new to vb.net.Pls help me any one.

View 2 Replies

Pass The Id Of The Parent To The Create View Of A Child?

Sep 30, 2010

I'm new to MVC2 and my question should be pretty basic. At least I thought so until I could'nt find any answer on the web, so here I am.

I have a parent object Pool that can have 0 to many children Question.

In my Details view of Pool, in addition to the Pool's property, I render his childs using RenderAction on the Question action List, so far, so good.

Inside my List view of Question (which is always rendered inside the Details view), I want a button to start the Create action of the Question object. My problem is, I don't know how to pass the Pool object, which is the model of my Details view, to the Create action so that I can link my Question to the right Pool.

Is there a way to access the "Master" Model inside the "included" view via RenderAction and if not, what's the best way to implement a work around.

View 2 Replies

Forms - Pass Variable From Child To Parent Like A Function

May 23, 2012

I have created 2 forms (Parent & Child), i want to store the unique textbox value to a variable into the parent form.

[Code]...

View 2 Replies

Listbox Navigate To An Added Usercontrol?

Dec 27, 2009

I developing an application in WPF. I wantedwork with MDI. OK not possible.

View 3 Replies

Asp.net - Pass Cancel Or Update Button Click From Popup Back To Parent Page?

Apr 25, 2012

I have a popup aspx page that receives data from a parent page gridview Edit click. There is a great deal of parsing of data from parent page to pop up as the data is being translated in pop up, then sent back to parent page to be reassembled in the original text block before update.

When the popup passes the data back or is canceled, the parent page gridview is still in Edit mode.I would like to pass the Cancel or Update button click from the popup to the parent page gridview so it can complete the update or cancel event without asking the user to click the corresponding command button link from the gridview edit mode, to Update or Cancel.

UPDATE: There is also a jquery UIBlocker on the Parent page to prevent the user from returning to the page until the PopUp page processing has been completed. Below is the critical code:

PARENT Page:
function parentFunc(a) {
// Unblocks on return from popup page.
$.unblockUI({});

[code]...

Had a problem with preventing the popup from reloading. So there is an if condition in the load event. A dynamic number of controls are built on the popup as literals. So the Page Init event and Page Load event fire on non Postback to rebuild the controls.

View 1 Replies

WPF - Usercontrol As ListItemTemplate Not Filling Listbox Width

Apr 11, 2011

Just trying to get my head round WPF. I have a usercontrol which I'm using as the template for items in a listbox, however no matter what I try the usercontrol's width is always shrinking to the minimum size but I want it to fill the available width. I've found a similar query on here but it was relating just to a usercontrol not within a listbox and the solution proposed doesn't apply here.

My UserControl is defined as :

<UserControl x:Class="uReportItem"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

[Code].....

View 1 Replies

Cannot Assign Selectedindex To A Databound Listbox If It Has No Parent?

Mar 22, 2012

It appears that I cannot assign the selectedindex for a databound listbox if it has no parent, but I can do so if I have populated the list "manually" from the same datatable. In my code example, the "if" line toggles between loading a list via data binding and loading a list "manually" (both use the same data table). In each case I attempt to set the selected index afterwards. With manual loading, the selected index is set; with data binding, an error is thrown (which can be avoided by assigning the listbox a parent, but the "manual" equivalent doesn't need this). Is this a bug?

[Code]...

View 2 Replies

Wpf Binding Text To Parent Listbox's Contents?

Jul 26, 2011

I have a listBox whose items are to be shown in a textbox format, like so:-

<ListBox ItemsSource="{Binding movieList}" Name="innerList">
<ListBox.ItemTemplate >
<DataTemplate >

[code].....

View 2 Replies

Should Changing The Parent Of A Listbox Change The Selected Index

Mar 22, 2012

You wouldn't think so, but it does when the listbox is bound to a datasource (as far as I can see).

I've reduced the behaviour to the code below. The "if" line toggles between loading a list via data binding and loading a list "manually" (both use the same data table). In each case I set the selected index afterwards, and then change the parent form. With manual loading, the selected index is retained, with binding it is lost. I cannot see how this makes any sense - I don't see why changing the host form should alter any property of the list. Is this a bug?

Public Class Form1
Sub main() Handles Me.Load
Dim ListControl1 As ListBox = New ListBox

[Code]....

View 1 Replies

Function - Pass Object Versus Reference Object In Parent?

Dec 1, 2011

I am working on a application that has quite a few functions involved and have been thinking of the following: If I have a function that has a few paramaters, is it more efficient to pass the objects to the function(Example 1) or reference the objects in the parent(Example 2)? Does it matter if the objects are large or not?

Example:

Class mainform
Public myGenericList As New List(Of String)
Public myDatarowArray() As DataRow

[Code].....

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved