UserControl Communication - Sharing Information Between User Controls
Nov 29, 2010Whats your preferred method of sharing information between user controls? Information stored in variables (strings,arrays, list of etc).
View 12 RepliesWhats your preferred method of sharing information between user controls? Information stored in variables (strings,arrays, list of etc).
View 12 RepliesI am trying to make a small control that has a picturebox and a few labels that can be dragged on the form it is placed on. The control was easy, and I can drag it fine when the mouse is down on the control, where there are no other controls, like not over the picturebox or labels.
When i try to click and drag the user-control and the mouse is on the picture box or labels of the control the mouse down event is not detected. I am hoping someone can tell me how to pass the mouse-down event from the controls on the user-control so the form I place it on detects the mouse down even no matter where on the control i click.
where i need to start to create "Online" (or transfer data / sharing data /Transfer information ) program?
I mean that two or more different computers with the program can connect with each other ... Like Chat, Online games, etc..
I am working on a program to integrate several entities of people to get them to work together by sharing information.I am having.I am using a database (Access) in which I can upload photos but can not understand how to store PDF and word.Also looking into implementing email.User inputs information on the forms with the attached (in datastore) PDF and word files and with one button email multiple users in certain areas.I can figure out how to code the email to: portion.Looking to be able to open a chat type interface. I understand I use the winsock com but I do not have it. Does anyone know what the heck this Adobe Breeze thing is?
View 2 RepliesI 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 RepliesI have a form that can spawn a child form, something like:[code]I want to be able to launch multiple children. Unfortunately, I seem to be getting conflicts within the controls of the children. One button will run the other child's control, etc. They also seem to think that their class-level variables are accessible to each other. Private Shared variables like the following are conflicting (one form thinks it's seeing the other form's "mp3file" variable as their own):[code]How do I spawn children forms that keep their controls and data separate?
View 1 RepliesI made a windows form application using Visual Basic. One window has these controls: a web browser , a textbox (textbox1) and a button (button1). The webr bowser will have buttons and a text box which will display different numbers
View 3 RepliesI am building an ASPX web site which has several pages and multiple users.I grab specific info about each user such as UserName, ID, etc. when they start a session and I need to retain this info and have access to it from each page (which has it's own class).I know i can create a global file and share variables publicly, but i need the variable values to be specific to the user, not the entire application.
View 2 RepliesI have a text box where i am entering numbers of double datatype andon the Keytdown event of the textbox some checks take pace and in certain circumstances I want to be able to stop the user from entering other information until they enter the right information in the textbox (where it says right here) . now when I say exit sub the textbox somehow loses focus . but this is not how I want it to be I want the textbox to remain with the focus so the user can change the information . How can i go about this. And the other thing is why is my txtDestPayRate1.Focus() just befor the exit sub not working?
Private Sub txtDestPayRate1_KeyDown1(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles txtDestPayRate1.KeyDown
If e.KeyCode = Keys.Enter Then
[CODE]...
How do I check whether the controls in a usercontrol contain any value?
I have created a usercontrol called ctlCustomerAddress and I want to create an address record in the database if only I have the values in the textboxes.
am trying to make use of inheritance to keep consistency in my user control appearance. I created a usercontrol to use as my base design, as a platform to link to a tab as acontainer. To this I added a few framing visual items like a header panel andsome labels.I then created another usercontrol that inherits from my base control, with the intention of adding the necessary items to this derived control to build it into a complete functional usercontrol that I can associate with a tab on my main form. I want to keep the visual appearance consistent across all similar derived controls. Then later if I change the design of the base form, this flows through to the derived controls.
View 7 Repliesi'm building a control. then the control can be puted in form(or other container) and i need to know what controls are in that container. for now i don't put it to work:
Code:
Public Sub AllControlsName()
Dim i As Long
For i = 0 To Me.Container.Components.Count - 1
[Code].....
VB.NET 2.0 Framework..I developed a control that implements IExtenderProvider in order to attach to controls and display a form for translating of the text of that control.This works great on regular controls on the form but the IExtenderProvider is not attaching to controls on UserControls by default.Is it possible to modify the UserControl or my IExtenderProvider control to enable it to attach to controls on a UserControl?
View 1 Replieswhat is the diff between custom control ,inherited controls adn usercontrol in vb.netadil
View 2 RepliesI want to set the value of x that is the location of the controls inside a selected usercontrol at runtime. i want to set it to be 0 when there is no control on the usercontrol and i want it to be x += control.width. how can i do this, maybe how can i detect that there is a control inside the usercontrol.
View 8 RepliesI need to valid the user credentials connecting to server using TCP communication. How to conver the following code compatible to VB.NET 2003.[code]
View 2 RepliesI'm using webclient to download a webpage but obviously since it's on the UI thread it freezes.How can i change my class to be multi threaded using DownloadStringAsync? i can do this normally but since i am needing to return the information back to the UI thread i am a bit stuck
Public Class RequestExecutableInformation
Public Function FileReport(ByVal executable As String, ByVal ParameterStart As String, ByVal ParameterFinish As String) As String
Dim Source As String = String.Empty[code]...
I have created a usercontrol that contains two rectangle shapes to create a unique button effect and a rounded-corner rectangle shape serving as a border to provide a look similar to a group box. It also contains two labels, one for use with a Text property of the control and the other to indicate the status of expansion of the control. The control is designed to collapse itself when the "button" is clicked leaving only the "button" visible. Clicking it again toggles this affect. I've dubbed it an ExpansionBar. It is also designed to be a container control so that I can add controls to it and allow these to disappear when the bottom portion collapses. The problem is that the controls contained in this usercontrol cannot be accessed during runtime. In other words, I can add a checkbox to it and it will disappear correctly when the control collapses, but I can't select the checkbox to check it... same thing with any other controls, you can see, but can't touch. I'm a novice developer, so I'm sure I'm missing something obvious.
View 12 RepliesThere is newer code in a follow up post. I suggest using the code in the later post rather than the code in this one. You can still read this post though. When designing a user interface, one should be conscious of how many individual controls are required to implement the functionality. In some cases an initial design may begin with many buttons or textboxes (for example) but then further review of
the actual required functionality allows for a reduction in the number of unique controls.
But other times, there isn't a better way (which will still make sense to the user of the application) then to have a series of many repeated controls. So in the cases where one can be certain that the best UI implementation for an application will require the use of multiple copies of a given control, then it often becomes necessary to maintain some method of managing all of those controls at various points
throughout the application. Doing so typically requires that one build up some collection of controls which can then be accessed by index in order to work with any given control; but this can lead to a lot of clutter in the code file which handles these control's events. For instance there will be some kind of collection declaration, some recursive routine to find all of the controls of interest, and then any number of event handler methods with long lists of Handles clauses, or additional code loops to wire up the event handling for each control.
Purpose Since most of this functionality could be considered a requirement regardless of the type of control being managed, or its required functionality, it may make sense to wrap all of the control management functionality into a single class. And since our first requirement is a collection of controls, then a base collection class could be the perfect starting point for our control manager. There are a number of existing thread around this topic, with some recent (at the time of this writing) ones being:[URL]..In this, and related, threads I have posted examples of a simple TextBoxManager and ButtonManager control. But again, with so much similar functionality required regardless of the control being managed, it would be technically possible to create a generic ControlManager(Of T As Control) class which can manage any type of control.
[Code]...
So in summary, one can facilitate managing a large number of user interface controls by building a "control manager" class which both encapsulates the list of control instances, and deals with adding and removing defined event handlers for every control it manages. The generic control manager class itself can be inherited and extended into a more specific class on a per-application basis in order to provide more application-specific functionality. Reed Kimble - "When you do things right, people won't be sure you've done anything at all"
I have some custom user controls in my .net winforms program that do not display correctly when the user has selected larger text size. This setting:
My controls look like this:
Instead of like this:
The bill to area and ship to area are both custom controls. I don't know if this is contributing to the problem but I do have code in each to scale the phone/fax areas to stretch nicely, like this code from the bill to control,
Private Sub panFaxPhone_Resize(sender As Object, e As System.EventArgs) Handles panFaxPhone.Resize
panFax.Width = (panFaxPhone.Width / 2) - 1
panPhone.Width = (panFaxPhone.Width / 2) - 1
panFax.Left = panFaxPhone.Width - panFax.Width
End Sub
How can I get my controls to size correctly while still respecting the users choice for larger text (I don't want to just set the AutoScaleMode to None)? After playing with this for a long time it seems to be a problem with anchors in the child controls. See this below image, the inner black box is the control with its border turned on, the text boxes (like name) are anchored left and right and should stretch to fill the control, but don't.
i have a windows from project and in that project i created a user control lets call itcustombutton1 now i can use that control quite easily either at design time or runtime by creating a new instance of it like
View 1 RepliesHow may one get information that was used to programatically generate asp controls?For example, I pulled a DataTable of user objects from the database and have organized them on a page, listing groupings such as a list of employees directly under the employer for each employer. On the page, I list each user's Username as a LinkButton. When I click one of these employees, I want to redirect the page (which is easy) and set a session variable to the selected user's UserId (which seems not so easy). How can I pull this UserId value back? These elements are not hard-coded with nice names (as they are generated in a for each loop).
Code from comment below:
Dim lnkbtnPm As New LinkButton ' is my link button. '
lnkbtnPm.Text = pmDr.Item("Username") ' where pmDr is my datarow. '
lnkbtnPm.CommandArgument = pmDr.Item("UserId")
[code]....
Just like an array in a group box or a frame as i used in vb6.
If there are 5 customers details then when i load the form it will add (PictureBox, Label and a listbox) for each customer dynamically and display them with their information. Moreover, if i add 6th Customer information in the database then next time i load the form it should display his/her information as well. I did this in VB6 sometimes back but need a start to do in .net
Private Sub LoadCustomerInformation()
Dim Qry As String
Dim RS As New Recordset
[Code].....
I have a form that has many controls. My next task is to populate the phone number (MaskedTextBox) and phone number type (ComboBox) when the cursor has lost focus from a ComboBox that has auto complete functionality. I have tried to do it and when the cursor leaves focus, the other controls are not populated. Nothing happens. I do not get any errors either. Screen shot attached for the form and I am also using a stored procedure to do this. There are two tables in question here. A client table that the name and phone number and then the second table that has the phone number type (cell, work, home, etc).There is an FK relationship between the two.
This is my stored procedure. It is called sp_GetClientInfoByName.
vb
CREATE PROCEDURE sp_GetClientInfoByName
[code].....
Can I safely move ReferencePath information from a .vbproj.user (or .csproj.user) file into the corresponding project file? Note: All developers will be using developing from the same location on their machines.We'd like to allow users to maintain their own settings for other things, but have this basic info be setup once and checked into source control to be shared to all.
View 1 RepliesHow many controls can I have before I should start looking at user defind controls because of too many controls making my program go slow?
View 4 RepliesI have MainLayout.master that has UC_Menu.ascx on it. I have a page named Customer.aspx that uses MainLayout.master. Customer.aspx also contains a UserControl named UC_Details.ascx.How can I have UC_Menu.ascx call a function that is in UC_Details.ascx with this scenario?
View 3 RepliesI have a Windows Form frmMain() holding seven more-or-less unrelated UserControls, ucFlopsy", "ucMopsy", "ucCottontail", etc...I say "more-or-less" because each of the seven UC has three similar public read/write properties:
IsLocked (a boolean indicating if the following two properties are "Locked")
IsLockedID (if IsLocked=True then IsLockedID is an integer)
IsLockedName (if IsLocked=True then IsLockedName is a string)
[code].....
How can i check if the username has a administrator role or a member..
here is my code..
vb.net Try Dim connection As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:UsersMaynielDocumentsVisual Studio 2010ProjectsSampleSystemUserAccount.mdb")'Get the count of the records with matching user ID and password.
[Code]...
I'm writing software in VB .NET (2005) which uses the Windows user information as login credentials - just the username. I've found Environment.UserName which works for the username (as you would expect).However, I need more information - I need the full name of the user (as shown on the Start Menu). It seems this information is stored... somewhere, as Windows is able to use it for things like permissions on file shares.
View 1 Replies