Can Have A Message Box Pop Up In A Form That Is Called Via ShowDialog
Jun 21, 2010I 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 RepliesI 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 RepliesI have a form being called form several forms using ShowDialog().
1. Is there a way for called form to know which form called it by receiving a code or key from the calling form?
2. The calling form has a gridview. How can the called form pick up a column's value from the currently highlighted row in gridview in the calling form?
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 RepliesI have a form called FrmPracDetails which is built up with a List view called LvwColProc. Therefore when you click a field on the LvwColProc it takes you to another form called FrmColProcessing, here you can make changes to certain fields which are also present on FrmPracDetails. What I want to do is when you make changes on FrmColProcesing and Click the Save Button (which calls the Save function)the changes appear instantly on FrmPracDetails. Please note, FrmColProcessing will always be open next to FrmPracDetails. I have tried to put this code in the Save function present in FrmCol Processing as shown below, but it doesnt Refresh FrmPracDetails form. [code]
View 1 RepliesI'm having an interesting issue that I can't reproduce on a different project, but can consistently on this one. I have no clue what might be causing it, but am hoping that someone may have seen it before.
I have a main form, from which I run a series of checks. On this form, I have a listview control. Because of some issues with the refreshing of this listview control, I had to create my own messagebox. It's just a form that displays some text ( it also happens to look nicer than MsgBox; in my opinion, anyways ). It's been working great for months, until recently.
My problem is that on my main form's load event, I run this check, which returns an error within a try/catch block. I then call my custom messagebox with a message. It in turns calls it's ShowDialog() function.
In any other situation ( after the main form has been loaded ), I have no problems. The messagebox goes on the screen and behaves appropriately ( ie: waits for my input and acts as a modal dialog ( stops execution of my main form's thread ) ). However, on this onload event, my messagebox comes up and goes away almost immediately afterwards.
I've traced it all the way to the showdialog() call. For no explicable reason, it appears to skip right over this call, without me doing anything on the form.
Here's what the inner trace looks like ( when I put a breakpoint on the onclosing event for this messagebox form ):
CODE:
Quote:
Originally Posted by kaliman79912
Quick note: Close does not dispose of the form if it was displayed using .ShowDialog, but I guess this is not the case.
I did not want to hijack the other thread [URL] but would like to have this clarified for me.
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 RepliesI 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 RepliesI 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].....
I have three form First Form is MDi form and Second Form Is Child Form and third Form Is small form.The small form conatin DataGridView searcher for name and I want whe I press the Event Mous Click he copy value from cell"column" of DataGridView to Child Form..[code]
View 7 RepliesIn 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?
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
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.
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.
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 RepliesI 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
im running this code to load a form and call a public method inside it:
vb
[b] newForm.Show()[/b]
Call newForm.editToolStripButton_Click(sender, e)
but when i use form SHOWDIALOG method it doesnt execute
Call newForm.editToolStripButton_Click(sender, e)
I am creating a VB program that has a Main class, and 4 windows forms. Each of the forms has a back and a next button to navigate trough the forms. The problem is that when I hit next (Here is the code)
Private Sub continueButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles continueButton.Click
VS 2008 Remember Textbox Text when Form reopens
im using visual basic.net and this is my problem i have 2 form which have a two datagridview . when i update the datagridview in the form 2 its working fine and when i exit it in the form 1 its also update , but when im trying to to click again the edit button(from form 1) the program is automatically exit or crash.
the code from my form2 exit button
form1.showdialog
me.close
form1 edit button
[Code].....
I've come across a situation where I try to run a simple line of code in a method Dim res As DialogResult = frmOptions.ShowDialog()but nothing happens. The dialog box will not appear. If I run this method from another location in the code it executes fine (i.e. displays the form in dialog mode and code executes fine thereafter). Hence, it may be the way in which I arrive at this code that is causing my problem, but I cannot see to find what is wrong.
When I pause the debugger the line of code is highlighted in green but I can't see to step over it or into it what may cause this to happen, or what I should be looking for that might be causing the problem??
Dim res As DialogResult = frmOptions.ShowDialog()but nothing happens. The dialog box will not appear. If I run this method from another location in the code it executes fine (i.e. displays the form in dialog mode and code executes fine thereafter). Hence, it may be the way in which I arrive at this code that is causing my problem, but I cannot see to find what is wrong.
View 8 RepliesI have a VB.NET 2010 Forms Application which includes a form with a textbox, and two buttons which I call from the main form using .ShowDialog
I've messed with something such that I can no longer prevent the dialog from closing when the user clicks the Ok button but has entered invalid information.
Here is the handler for the OK button's click event:
Private Sub cmdOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdOK.Click
If SomethingIsWrongWithWhatTheUserEntered Then
[Code]......
I have an outlook application, whenever the user receive a new mail I show him a form and some controls
The user needs to insert information and close the form. Sometimes the user is not near his machine so whenever there is a new mail I am adding new controls and modify the child size.
It has been successful using the Form.show() method but not in showdialog() i cant add controls and change the form size can someone please help on the subject?
[Code]...
This is what I have..Dim frmSettings As New frmOptionsfrmSettings.ShowDialog(Me)frmSettings is a settings form that you can choose the color for background of form1(Me)
View 1 RepliesRequested were made by Businese Analyst to set the few Main FORMs VISIBLE PROPERTY TO FALSE when the POPUP FORM is loaded.
[Code].....
When the MAIN FORM loads the POPUP FORM, on the FRMPOPUPCUSTOMER-FORMLOAD even, it has to set the MAIN FORM Visible to False.
When FRMPOPUPCUSTOMER FORM IS UNLOAD it has to set the MAIN FORM Visible = TRUE.
How to the coding is to ensure that different MAIN FORM when loaded FRMPOPUPCUSTOMER it will turn the MAIN FORM Visible to FALSE.
I have two forms. Form1 and Form2. The user is supposed to fill out some information in form2 which then will be used to compute some data in form1. However when I used the code, Form2.Show, within a function in form1, the form2 is diplayed but when the user fills the data and submits them using the ok button, the code does not return back to the function in Form1.
View 3 Repliesam trying to figure out why my 2nd form is not displaying the value i recived in my first form.The code for the first form is:
Private Sub scannerOnCom_DataReceived(ByVal sender As Object, ByVal e As SerialDataReceivedEventArgs)
responceBack = scannerOnCom.ReadLine
[code].....
i was wondering if it possible to have a condition where lets say you have a column in the datatable called amount and a textbox acting as the filter called say maxamount to set it so the rowfilter when filtering the table will sum the number in the amount column until the number in maxamount is met, then stop and only return the rows where the total sum of the amount column is equal or less than the maxamount value, so i guess if the next row takes us over the maxamount it discards this row and returns the rows previous to it. is this possible using datagridview rowfilter or should i be loooking elsewhere to achieve this?
View 4 RepliesI have an sql table called Stock with two fields called StockID and StockCode. I want the user to select the stockcode from a combo which in turn populates the stockid for that item into a lable on my form. I have already populated the stockcode into the combo but dont know how to compelte the rest.
Imports System.Data.SqlClient
Public Class cbo2
Private Sub cbo2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
[CODE]...
I have the following line of code in my program:
JCL_History.Enqueue(JCL_History(I))
This JCL_History object is basically a Generic.List encapsulated in a wrapper and has the following method:
Public Sub Enqueue(ByRef value As String)
If Members.Contains(value) Then
Me.RemoveAt(Members.IndexOf(value))
[Code].....
In my testing I have 2 items in this JCL_History list. When I call that first line of code I posted (the one that invokes Enqueue) with I = 1 I expect the first item to be shuffled to the bottom and the second item to be shuffled to the top.
After the thread returns from Enqueue I notice that this is exactly what happens to my list, HOWEVER if I hit the "step_in" button after the execution of Enqueue I go into the Default Property's set method where Index = 1 and value = and it screws everything up, because the item that got shuffled to the end (index 1) gets overwritten by the item value shuffled to the top.
So basically the set method on the default property is getting called at what I think to be a completely ridiculous time. What gives? By the way I'm running VS2005 on XP.