UserControl Will Not Update Using ShowDialog()

Nov 16, 2009

I have a form that uses another class to do some work, and the class throws events regarding text updates, and the main form handles them and passes them on the the StatusForm, which displays the process progress via usercontrol. Using a BackgroundWorker and Events I'm able to update the usercontrol on the Status form if I use frmStatus.Show(). Unfortunately, the Status form should use ShowDialog() so it can't lose focus while the application is processing data. Now, for some reason the UserControl will not update if I use ShowDialog(). Any ideas?

View 7 Replies


ADVERTISEMENT

Asp.net - JavaScript Update Field In Another UserControl?

Dec 20, 2010

I try to explain better. I have one user control in page, and inside this have UC2 (modal pop up). And I try to achieve this: When I close UC2(modal) i try to update some fields on UC1. And this works fine for one(I have UC2(modal) and on button Save OnClientClick="SaveInfoCI()"), and in UC1 on top of page

function SaveInfoCI() {
document.getElementById("<%=frmData.FindControl("txtImplementingCI").ClientID%>").value
= document.getElementById("<%=UC2.GetClientID%>").value; }

but because i reuse this control in another place i want to update another field. Basically now i Have 3 JS function that update 3 fields. And I try when I click save in UC2(modal) I must execute one of this 3 javascript f, to update right field. I don't want to have 3 same UC with only difference in OnClientClick="SaveInfoCI().

View 1 Replies

C# :: Call Function From UserControl On ASPX From UserControl On MasterPage?

Jan 31, 2011

I 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 Replies

UserControl Access To Public Properties In Another UserControl?

Jun 12, 2011

I 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].....

View 1 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

Asp.net - Reference TextBox In One UserControl From Another UserControl

Jan 19, 2011

I have two UserControls on a MasterPage. DataEntryUC contains several TextBoxes and DropDownList. NavSaveUC contains navigation buttons. When the user clicks on a navigation button, I will be saving the data entered into DataEntryUC from the NavSaveUC UserControl.

I have a couple of tables in my DB that contain stored procedure names, control names, control types, SqlDbTypes, etc.... that correlate with DataEntryUC.

How do I reference a text box that is on DataEntryUC from NavSaveUC?

I have been working on the following code from NavSaveUC with no luck.

Dim MyControlName = "txtFirstName"
Dim MyControlType = "TextBox"
Dim MyStringValue as String

[Code]....

View 2 Replies

Setting Usercontrol Properties Within A Usercontrol

Mar 22, 2012

I have a usercontrol that has a main form and calls another form within the usercontrol to get some data from a database that allows the user to select some items from a CheckedListBox control on the sub form. I want to pass the selected items from the CheckedListBox back to the main form and display the results there. I have a public property called DBList of type List(of String) on the main user control. If I create a reference to the usercontrol form the second form within the usercontrol I get a new instance of a user control. All I want to do is set the property on the usercontrol and close the secondary form. How do I reference the usercontrol from the form within the usercontrol?

Code in UserControl:

Public Property DBItems() As List(Of String)
Get
Return DBItems

[Code]....

View 3 Replies

VS 2010 Load Data Into UserControl In UserControl.Load?

Sep 25, 2011

I just discovered the joys of UserControl's and I was wondering if it is possible to populate the usercontrol with data from a database in the UserControl's Form.Load event instead of the form the userControl is placed on. I feel it would make using the control a lot easier if it just populated itself without anymore code.I tried it with a ListView but it gave me a bunch of errors, so I didn't know if it had to be done a certain way or if it was just one of those things that doesn't work no matter what.

View 8 Replies

Clearing Textbox In ShowDialog?

Sep 20, 2010

I'm having issues with program that uses radio buttons to select between 2 different forms, that are displayed using showDialog. When I click a button to perform calculations in either form, it will act normally and display the information, however when I click the Clear button to begin a new calculation, the form will close, does anyone know why?

View 1 Replies

Form ShowDialog Disappears

Feb 24, 2009

I have a form that I am using to search for records in a dataset, it has a text box for entry of the search criteria and a 'Search' button to initiate the editing of the entry and .Filter on the BindingSource. This is one form in a project with many, when I show it using .ShowDialog it always disappears, (not visible and not loaded) after the 'Search' button is clicked, I have stepped through and there is no .Hide or .Close that it encounters, it performs all of the logic correctly but control is returned to the main form it was shown from. When I use the .Show method, I do not have this problem.

View 5 Replies

Forms :: Showdialog Within Another Thread

Jul 16, 2010

where I am starting another thread which opens a form. Succinctly, it is an animated "Please wait.. processing" type of form. The issue is that I want to make this form a child form of the parent (main thread or main GUI) when I open it.The issue is that I prefer to use frmProcessing.ShowDialog(frmMain) instead of just frmProcessing.Show, because of form disappearing issues. It, of course, gives me an error of illegal cross thread operation. My question is, how do I perform frmProcessing.ShowDialog(frmMain) to show from within another thread, that the newly opened form is actually a child of the main thread. Is there a better way for me to make a small processing form telling the user to be patient while background processes are working? [code]

View 2 Replies

Openfiledialog Does Not Pause On Showdialog()?

Feb 22, 2009

When I run this code, it does not seem to open the OpenFileDiaplog diaplg box, or if it does, it closes it immediately, and I get at index out of bounds exception at the " infileStream = getFile.OpenFile()"This exact same code works without problem in another application I am building. So maybe its something about the IDE environment?I think, but am not certain, that this code worked in 2003 .net. I then used the VS wizard to automatically convert to the 2005 environment that I am now coding in.

Dim infileStream As Stream
Dim getFile As New OpenFileDialog
getFile.Filter = "All files (*.*)|*.*"

[Code]....

View 8 Replies

ShowDialog Form Not Ending

Nov 4, 2010

I converted this app from VB6. I have 2 forms. Form1 instantiates Form2 via a Menu Item.I am having trouble getting Form2 to end when clicking close (X). If Form2 is 'idle' it closes fine; but if I am in a loop processing anything all the events fire, but it continues processing in Form2. I've tried messing with Dispose, Close, Application.Exit, Application.ExitThread. My last attempt was creating my own event to fire back to Form1 and dispose Form2 -- and it hits it but Form2 is still running. What is the deal? BTW if I use just Show vs ShowDialog -- Form2 just blinks and disappears.[code]

View 2 Replies

ShowDialog Form Not Ending?

Jan 21, 2009

I converted this app from VB6. I have 2 forms. Form1 instantiates Form2 via a Menu Item.I am having trouble getting Form2 to end when clicking close (X). If Form2 is 'idle' it closes fine; but if I am in a loop processing anything all the events fire, but it continues processing in Form2. I've tried messing with Dispose, Close, Application.Exit,pplication.ExitThread. My last attempt was creating my own event to fire back to Form1 and dispose Form2 -- and it hits it but Form2 is still running. What is the deal? BTW if I use just Show vs ShowDialog -- Form2 just blinks and disappears.

Form1 does this
Dim f2 as Import
:

[code].....

View 6 Replies

VS 2005 OverLoading Showdialog?

Sep 28, 2011

I wanna overload the ShowDilog for my form. I wanted to clarify whether the Owner should be passed as Value or Reference.

View 2 Replies

VS 2010 ShowDialog On A Different Thread

Nov 9, 2011

[code] For some reason, and I don't know why. The same CustomSplashScreen that had a handle for UpdateText shows to not have a handle when I call .Close().So basically it would show the splashscreen and update the text, but the form would be left opened and not closed like it is supposed to be.

View 2 Replies

.net - How To Wait For Form To Close Without ShowDialog()

May 9, 2012

In my program I use WebBrowser control for OAuth. It's located on vk_auth_window form. So in the code I call vk_auth_window.WebBrowser1.Navigate(vkauthurl). If authentication is successful, I silently get token, but if user is not authenticated a form vk_auth_window is showed to them to enter username and password. To check this I catch _DocumentComplete event and check for the right URL. I need no other code being executed until the user finished authentication or closed authentication form. ShowDialog() does the trick, but it somehow hides cursor from username and password fields in WebBrowser control. So I introduced a variable Dim showform as Boolean=True in and set it to False from the _DocumenComplete event and in the main code I use infinite loop.

While showform
System.Threading.Thread.Sleep(100)
Application.DoEvents()
End While

However it makes userinput slow due to thread sleeps. And If i remove them, it loads CPU quite a lot. Is there a better way to wait for form to close? What is it?

View 1 Replies

.net - Shared Form.ShowDialog Method?

Apr 18, 2011

I have a new developer that is calling Showdialog (in VB.NET) on a Windows Forms form without first creating an instance of the form.How is this possible? I don't see a shared method for ShowDialog...

I'm not crazy about this approach either as it seems to me that the dialog will not be disposed until the application exits.What am I missing? Is this a new best practice?OK, Form2 is just a blank form.Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object,

ByVal e As System.EventArgs) Handles Button1.Click
Form2.ShowDialog()
End Sub
End Class

View 1 Replies

Block Like ShowDialog Blocks But Without A Form?

Sep 10, 2010

So you know how when you call "Form.ShowDialog" from where ever you call it, it blocks until the form being displayed closes. And then the function returns whatever result it was.I want to know how to block like, but without a form, yet still have the "main ui thread".Basically I have this long process that needs to thread out and do several things... and it's heavily event based. It jumps between two threads, the main ui thread, and it's own background thread. The main ui thread needs to have access so that I can randomly open different dialog boxes for things... sometimes they're just windows asking to hit OK or Cancel to continue, others it's to perform some action, etc etc.

But there is NO central form related to it. It's a complete background thread running that randomly hops over to the main ui thread for things.Right now I have this class I designed called lets say "DoJobProcessor". On it is a function called "BeginDoJob" that threads off from the thread pool... when ever I need to jump back I use a ManualResetEvent to block on the background thread, jump over to to the main thread with "invoke" and passing a reference to the MRE, then release the block when done there and continue on on this background thread.

All while this is going on I just set the form I'm trying to block the main ui thread from managing by just setting its Enabled property false.It all feels just messy and annoying... and I was just writing something using ShowDialog and I was like... HEY, what if I could block this BeginDoJob method, hi-jack the main ui thread, then let that function return the result when done instead of having this "Complete" event with the return value in it. It's obviously possible because ShowDialog does it, but I don't know how.

This way the job I'm performing isn't always waiting for the main ui thread, instead its the other way around... the ui thread waiting for it, the way it aught to be. Show something, branch off do some stuff and just idle the display while it does it, come back show something else, branch off and just idle while it does that.

View 6 Replies

Can Have A Message Box Pop Up In A Form That Is Called Via ShowDialog

Jun 21, 2010

I have a form that is called w/ ShowDialog. Inside that form, I want to pop a message box to ask the user a question, but it doesn't show.[code]

View 2 Replies

Desktop Showing When Showdialog Called

Aug 20, 2011

When i close one window and open another using showdialog it shows back window or desktop for a while and then open the required one. I want to open directly without showing back window

View 1 Replies

Double ShowDialog - Do Not Get A Compile Error

Sep 23, 2011

I am teaching myself VB.Net at the moment but seem to be doing something wrong with ShowDialog. It pops up twice when I run the program. I do not get a compile error. [Code]

View 10 Replies

Form Load Data Before Showdialog?

May 17, 2009

I have problems with a form and load event.My form manage items that can be added, deleted or modified. In load code, I initialize all vars to cero. This is OK to be ready to add items.

My problem is with modify and delete. To carry this, I must load vars from a source. So, in my foreing code I have this:

[Code]...

My problem is that when showdialog is called, all data which were loaded from duplicar funct is put again to cero. How can I avoid this and load correct data into the form.

View 2 Replies

Formx.ShowDialog - How To Make Sure Focus

Feb 22, 2009

When I add a new vendor to a screen I'm using a .ShowDialog on a simple form to ask for a couple of key fields first - like the name and some "must be unique" fields.

[Code]...

View 1 Replies

Get New Form Inmediately After Form2.showdialog()?

Feb 24, 2009

I am writing an application in VB2008 with several forms. From Form1 I open a new form with me.hide() and then form2.showdialog(). The system works but in form2 the application runs without screendisplay until the program waits for a user input. So first all databases are processed. Meanwhile no screen is visible for the user. Sometimes this takes about 5 seconds. I would like the user to see the build up screen directly.

View 9 Replies

Open A Form As Modal Without Using Showdialog()?

Feb 11, 2011

I want to open a form as modal without using showdialog()Problem with showdialog() is we can not open the form as mdi child with it. i want to open few forms as modal but as mdi child forms. but i want to make sure user cannot go anywhere else without closing thst form.if we set parent form enabled = false then i can not set it as mdi child otherwise that form also becomes enabled=false.

if we write showdialog() then so many form icons will appear on taskbar. it we open as mdi child then only one icon appear i don't want to appear so many icons on taskbar so i want to open as mdi child but as modal

for eg. Mainform = mdi form
from mainform open formA = as mdi child of main form (but modal)
from formA open formB as child (modal)
from formB open formC as child (modal). if i use showdialog() then so many form icons on taskbar.
h2007

View 4 Replies

Radio Button Selected When Use ShowDialog

Jan 6, 2009

If I have two radio buttons on the first form of the project, they are both uncheck by default. However, if I have two radio buttons on a form that I open with MyForm.ShowDialog(), the first radio button is checked! Is there a way to stop this?

View 4 Replies

ShowDialog Causes Flashy And Lost Focus?

Jun 29, 2011

A MDI form which is used to call a child form (frmCust), there is a customer datagridview in the child form whereby user can double click on any customer row to call out the frmCustDetail form to display all customer details.I have got what i want but I encountered two problems shown as below.2) Lose focus - Sometimes when i close the frmCustDetail and get back to the child form. the whole

View 3 Replies

ShowDialog Throw Thread Exception

Feb 18, 2011

I have written a VB.NET 2.0 code and in my code i am calling class.Showdialog and for that i am getting thread exception. I have mentioned the call stack of the exception. Can any one help me out to resolve this issue. [code]

View 5 Replies

VS 2005 Showing Another Forms Using Showdialog?

Apr 27, 2009

I make a program upon sending emails to my friends using smtp. The problem is that I have confusions why my another form will not show until it is not finished sending all of the messages. I want my next form to show how many percent were finished but the problem is that my form will show only until all the emails are sent on my listbox. I put my code on the load event of the for

View 5 Replies







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