How To Block A Form

Jul 6, 2010

i have a simple question. in vb6 you can block the form using modal. but in vb.net i dont find any thing like this. so is there a way to block a form when other is opened. now i do this:

Dim frmDisc As New frmDiscount
frmDisc.GET_SENDER(Me)
frmDisc.Show(Me)

and in form Discount i do this:

Public Sub GET_SENDER(ByRef frm As Form)
frmSender = frm
End Sub

[code]....

View 11 Replies


ADVERTISEMENT

Block A Button In Form?

Apr 4, 2010

I have a button called "SendMoneyOutButton" in MainForm, I have a label call DecisionLabel which is binding to datasourceIs there is anyway to prevent the button SendMOneyOutButton is pressed if DecisionLabel.Text = "Already Sent"

View 3 Replies

How To Block Form Move

Jun 18, 2009

I have changed the form controlbox from true to false, it is same for maximizembox and minimizebox. When I move the form titlebar, the form are still moving. How do I avoid the form from being moving on the titlebar

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

Block Double Clicking The Form Title Bar?

Nov 1, 2009

i have been working on an app, that remains just my preset sizes. recently, i have discovered that by double clicking the form title bar, even w/the formborderstyle being set to fixedtoolwindow, the form still maximizes and all of my controls remain in the top/left corner.. not a good view.. so, i set the maximum size of the form, and now when double clicking it, moves it to the top/left of my desktop.. not a good result. here is a quick sample to start w/.

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

[Code]....

how do i permanently block the double click on the title bar, to have no effect on the form? i do not want to end up w/having to create a borderless form just to avoid this..

View 3 Replies

Block Start Menu To Show A Form?

May 13, 2011

I want to open a form when the start button is pressed.

View 5 Replies

Closing A Form On The Load Event In A Try Catch Block?

Dec 12, 2009

okay i have this code

Private Sub Form_OpenGradeBook_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

[code].....

View 6 Replies

Creating A Form That Will Block The Functionality Of Keyboard And Mouse But Apparently It Is Not Working?

Nov 3, 2011

I'm creating a form that will block the functionality of keyboard and mouse but apparently it is not working.

Here is my

Public Class Form1
Declare Function BlockInput Lib "User32" (ByVal fBlockIt As Boolean) As Boolean

[code]....

View 5 Replies

API For Block Tab Key?

Jun 3, 2011

i have problem in vb.net window base application.i want to block TAB key from the keyboard.PI code or any useful hint to do that.

View 1 Replies

Block If Without End If?

Jul 6, 2009

I assume i have more number of If and less End If i cant find it where its going wrong?

______this is the code below _________________________________

Private Sub CommandButton2_Click()
Dim app As Object
Dim Slide As Object
Dim ppApp As Object

[code]....

View 2 Replies

Block The Alt Key?

Nov 26, 2009

im doing a login i have finish it but you can close it by using alt+f4 so i need to block the alt key im using vb 2008

View 5 Replies

Add To Me.Controls Within With Block

Jul 20, 2011

How can i add this to Me.Controls within the With block. [code]

View 4 Replies

Block Registry Changes?

Nov 7, 2006

I am looking for a way to block registry changes unless I choose to allow them to be made. So basically if an application tries to make a change my program would display a dialog with information of the change and I can either click Allow Change or Disallow Change.

Only thing is I am not sure how I go about stopping a registry change before it happens.

View 5 Replies

Block The Window Key Using VB?

Jun 11, 2009

it is possible to block the window key using vb.net...

View 1 Replies

Block Value In Text Box?

Jul 4, 2011

in vb6 to block value in text box i using :

text1.setfocus
sendkeys "+{home}"

How if i use in vbnet 2005 ?

View 7 Replies

Block Webpages And More?

Sep 22, 2010

I'm working with an antivirus scanner.But I would like my scanner can block websites.So that some URLs are blocked from any browser[code]...

View 6 Replies

Conversion Of Php Block To Vb Or C#?

Nov 22, 2011

I have this block of php that i want to convert to c# or vbnet. I am stuck on the array methods since there is no direct equal to the is array and other bits like array merge. I know that arrays behave differently in php than in c# but thats about it. I am looking online but have not found anything yet.

private static function processArgs( $arguments )
{
$args = array();
foreach ( $arguments as $arg ) {

[code]....

View 2 Replies

Enumerator Within A USING Block?

Jul 20, 2010

I tried utilizing a collections Enumerator inside of a USING block to take care of the Enumerator.dispose call for me, however, I'm getting NullReferenceExceptions when trying to access the Enumerator.Current property after doing a MoveNext.

[Code]...

View 2 Replies

Equivalent To C#'s 'using' Block

Sep 2, 2010

I am coding in VB.NET.

Currently, I am enclosing object initialization and usage in a Try/Catch block and then tear it down (dispose, close, set to nothing) in the Finally block. The problem is, a C# 'using' block is so easy to use and would clean things up in my code.

Is there a VB.NET equivalent? Or is my Finally block tear-down solution the only way?

View 4 Replies

How To Block Popups

Apr 4, 2010

How to block popups

View 1 Replies

How To Block Shutdown

Aug 1, 2009

How to block shutdown using vb.net?

View 1 Replies

IE Download Pop-Up Block?

Oct 23, 2010

I have a form in vb.net that has a ShockwaveFlash object in it, and I get an IE popup requesting to download a file. I changed variables in it and it blocked some of them.

View 5 Replies

Is A Do Block The Same As A With Statement

Jul 14, 2009

Studying Ruby and the Do block. Coming from much c# I didn't see much that reminded me of Do, but then VB came to mind with the With statement and one which I wish was in c# (maybe it is and I never saw it?). The two statements, Do and With, appear similar.Is the With statement in VB the same as a Do block in Ruby? [code]I understand what I will get just from looking at it. I know that I will get a new record in my database with the above information, but I do not know why. Why did book become TheBook.new?

View 5 Replies

Sql - Use A Try And Catch Block In .net?

Mar 19, 2011

For the code shown below, how would I use a try/catch block to handle an error if it were to occur?

TOTKILO.Text = KILO.Text * TOUCH.Text * 0.01
TextBox10.Text = TextBox9.Text * TextBox8.Text * 0.01
K = Math.Round(Val(TOTKILO.Text) - Val(TextBox10.Text), 5)

[code]....

I used VB.Net controls and LINQ to SQL to perform all Updates and Inserts, so when an error occurs I want to show "Enter Data Correctly", how do I do that once I catch an exception?

View 1 Replies

Use Finally In A Try Block?

Apr 3, 2010

I often use the Try block to catch exeptions, and I have read in the help pages to do with the Finally statement. But, from what I understand it has no use whatsoever. Why would I use Finally instead of just ending the Try block. For example, from what I know

[Code]...

View 17 Replies

WebBrowser Block Ads?

May 31, 2010

I have a Web Browser that navigates to some websites, and I would like to know how would I go about blocking ads, just wondering is there any examples around, or can someone give me some ideas.

View 4 Replies

Why Does W7 UAC Block Program

Sep 24, 2010

I have a very simple VB 2005 program which runs on our W2K and XP systems, but when I try to run it on W7, the UAC throws up an admin login block. I have tried signing the assembly, to no avail. The entire program is below:

frmSimpleTest.vb:
Public Class frmSimpleTest
Private cabsdirectory As String = "C:HOTRMHMR"

[Code].....

View 7 Replies

.net - Logging Application Block?

Aug 18, 2010

We have a current implementation of a log file manager where it's two main purposes are to 1. rename files generated by other programs with a date/time stamp so they create new ones, and 2. delete files older then X amount of days from a specified folder. The program also makes it's own log file which records when these events happen.Do you think the Logging Application Block would be useful in this instance? The old file manager is written in VB 6.0 and an upgrade to VB .Net would not take too long, but is it worth it to try and implement LAP into it?

View 1 Replies

Asp.net - Catch Block Not Catching?

Aug 8, 2011

I have a simple function which tries to get a value from an Obout grid filter column, and if the value is empty, ignores it and moves on. For some reason this code ignore my catch block and always shows a System.FormatException when the input string is empty More bizarre, if I use visual studio's debugger and set a breakpoint on that line, the catch block functions normally (after I continue from that line). I have already confirmed that my Debug | Exceptions | CLR are not set to catch when thrown. I have also confirmed this same behavior in the production version.

[Code]...

View 2 Replies

Assert.Fail Within A Try Block?

Jun 23, 2011

My understanding of assert.fail was that if the line is executed, the test will fail.owever, I have found an instance where the assert.fail is executed, but the test passes.If the Assert.Fail statement is within a try block, the test will ALWAYS pass, even if the code execution executes the assert.fail. For example, the following test will always pass, even if the sub fails to throw an exception.

View 2 Replies







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