Remove If/endif Leaving Contents Intact

Mar 7, 2012

I have a situation like this:

if <some test> then
do lots of stuff
endif

I'm refactoring the code getting ready for some major work. I want to remove the if/endif pair but leave the contents (do lots of stuff) intact and in place.

In Visual Studio 2008, what is the easiest way to do that without making a mess

View 4 Replies


ADVERTISEMENT

IDE :: Highlight A Block That Is Excluded By #if #endif In 2008 SP1 As It Is In C# And C++?

Jun 29, 2009

When I exclude a block using #if #endif in VB.Net there is no visual evidence that the block has actually been excluded unless I indent the block and it does not return to the left margin. I checked the active settings for Fonts and the Excluded Code colorization is identical to that of C# and C++. However, the block is not colorized at all. VB clearly knows the block has been excluded, but I cannot figure out how to get the block highlighted as it is in C# and C++.

View 3 Replies

Keep App Settings Intact Before And After Update?

Aug 9, 2009

I notice that my.settings are all cleared after a clickonce update... What should I do to keep settings intact... Can I possibly copy the settings file somewhere at form unload and restore them at form load?

View 1 Replies

Keep Application Settings Intact Even If Reinstall?

Jun 6, 2012

I developed an application, which has the ability to save custom settings in application settings variables. The user saves his setings and it works perfectly. The problem is when i update the application to new version. I will be uninstalling the old version and install the new version. At this time all the user settings are set to default. How can i make my application to not distrub the user settings and keep them intact. Is there any alternate. PBL (Visual Studio 2010 Professional, Win 7 64 bit Ultimate)

View 3 Replies

VS 2008 - How To Remove Some Contents From String

Sep 14, 2010

I need to remove some content from string.
dim id as string ="TabContainerContent1_Basic_MyFirstName"
I need to remove TabContainerContent1_Basic_ . The fix is TabContainerContent1, it is under loop so always _Basic_MyFirstName will be changing. I need to get the text after the last _ char.

View 2 Replies

C# - ASP.NET - Get A Root Leaving Routing?

Dec 1, 2011

I have already managed to get friendly urls working with my cms; however, what i want to know is: with asp.net 4.0 routes options, how do i get a root leaving routing? When user types in www.mysite.com/page_name, which is aboutus, it goes to the page cms.aspx but leaves the other routes intact:

[code]...

View 1 Replies

Code When Leaving A TextBox?

Oct 6, 2010

When a user leaves a TextBox on the form I execute a format and save to a variable. This is saved to a database by clicking on a ToolStrip button.

The problem occurs if the user moves the mouse directly from the TextBox to the Button. Neither the Leave event or the Lost Focus event is triggered, the variable is not created and, of course not saved.

If I put the code in the Save Button and the User moves to another control, the formatting(data type Double to currency format in the TextBox) that I want to show is not executed.

View 13 Replies

ConfirmationBox While Leaving Form

May 9, 2012

My
vb.net
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Closing

[Code].....

How to stop form closing?

View 9 Replies

Leaving A For Loop When A Condition Is Met?

Jul 20, 2011

So I have a few variables in an array a I want to compare another variable to each of them, if it is the same do something, AND STOP THE FOR LOOP. else carry on the for loop. So...

for i = 0 to 4
if variable = a(i) then
do some stuff

[code]....

how do i end the for loop from within an if statement that is in the for loop

View 2 Replies

.net - Leaving Time Delay - Freezing The UI

Apr 9, 2011

this is urgent. i have a form in which i need to give timedelay of 3 seconds before each line executes. But when i try system.threading.thread.sleep its freezing the UI and furthermore all delays are executing as one single delay. that is

[Code]...

View 5 Replies

INSERT Statement Leaving Out One Piece

Aug 24, 2011

I have a modal pop up that is supposed to upload documents. It does that just fine, except that it doesn't give them a title, therefore nothing shows up on my page since Title is how they show up in the list. What should I replace LinkTitle.Text with to get this to work?I am trying to fix this guys code because none of it worked right. I added a comment below that has new code in it that is parameterized. This is in ASP.net 4.0 VB using Microsoft SQL Server.[code]

View 1 Replies

Valid Methods For Leaving Form?

Jan 7, 2009

I find that if I do me.close and then reopen the form with showDialog later, things are as they were before I closed it. If I use me.dispose and then later open the form again, its as if it was never opened before. Are these two both valid methods for leaving a form?

View 6 Replies

VS 2010 Disabling All, Though Leaving A Few Enabled?

Aug 17, 2011

The simple line:

Enabled = False

Leaves the user no options to do anything with the program.What I want is to disable everything using the given line (or if anything else), but leave a Menustrip enabled.

View 3 Replies

VS 2010 Run Code When Leaving Text Box

Sep 12, 2011

I'm trying to update an old code that I don't have the source code for. In this code, the user enters an integer in a textbox as part of a form. Once they move to the next textbox a new form opens to input the number of files that the user chose (in the textbox).I have created all of the forms, but I can't figure out how to get the code to open the new form once the integer has been entered in the textbox and the cursor has moved to the next textbox. I would prefer this to happen automatically and not involve a button.

View 13 Replies

.net - ADOX Leaving File Handles Open?

Apr 27, 2011

I am experiencing a strange issue with a VB6 -> VB.Net conversion. There is a function that uses ADOX to look through the tables in a given database, and reset the seed values of any columns in said tables with the auto increment property set to true.I tracked the issue down to a call of "col.Properties("Autoincrement").Value". If this line of code is commented out, then the file handle properly terminates when I close both the ADO and the ADOX connections at the end of the function. If I leave that line in, the handle stays open despite the closing calls and forcing garbage collection.Here's how I am closing the objects:

System.Runtime.InteropServices.Marshal.ReleaseComObject(adoConn)
Dim connection As ADODB.Connection = cat.ActiveConnection
If Not connection Is Nothing Then

[code]....

View 1 Replies

Find Where This Code Might Be Leaving Old Connections Open

Jan 11, 2010

I'm trying to find where this code might be leaving old connections open, and I found this code that might be the cullprit. It is in a function. I'm wondering if this connection would close, if an exception occured from within the USING statement?

[Code]...

View 3 Replies

Game Programming :: Keep Picture Box From Leaving The Form?

Feb 9, 2011

How do I keep my picture box from leaving the form screen and how do I make it 'bounce off the walls" when it hits one edge of the form?

View 4 Replies

Moving Shape Leaving A Trail Of Copies Of Itself?

Mar 7, 2012

Using a timer, am making a rectangle platform move from left to right. The problem is that it leaves a trail of itself and I believe this is down to refreshing or something. here is the timer code if your interested:

If shaperet = False Then
Timer2.Start()
platform.Left -= 4

[Code]......

View 17 Replies

Process .Text Data Before Leaving Control?

Mar 16, 2009

I'm looking for a way to process the text entered into a textbox, before the the focus is lost from the control. Or a way to pass a reference to the control to a function/sub when the control has lost focus. In Access I would be able to use the AfterUpdate event. I have tried the following events, but have not figured out how to get what I want from either of these events:

- TextChanged (tried to capture the Tab key, didn't work)

- Validating (when fired for Text1, the ActiveControl name is Text2 which is the next TextBox control)

View 4 Replies

Copy Contents Of One Array Of Booleans To Another, Preserving Contents But Adding Additional Boolean Values?

Nov 11, 2010

i have an array of booleans whose current boolean values I want to preserve but add additional length to the array? How can I achieve that? My code looks like this:

Dim Array() As Boolean
Dim ArrayInterimShort() As Boolean
ReDim Array(119)

[code]....

View 9 Replies

Get An Event When A DGVCB Selection Is Made (without Leaving The Cell)?

Feb 26, 2010

I have a DGV with a CB column in VS2008. I would like an event when a DGVCB selection is made (without leaving the cell). It will probably have to be a DGV cell or row event but I can't find one that fires as soon as a DGVCB selection is made.

View 3 Replies

VS 2010 Parsing Html Leaving Only Flash Movie?

Jun 14, 2010

i am having trouble getting this to parse and remove the html and only leave the flash applet here is my code so far:

WebBrowser1.Document.Body.InnerHtml = WebBrowser1.Document.All.Item("object").OuterHtml

View 1 Replies

Validate The Contents Of A MaskTextBox With Contents From An Array Or List?

May 10, 2011

I am trying to create a code where I placed sets of numbers in an array.I'll use a masktextbox to have the user enter the numbers to match what's in the array. If the user enters the number, ex: social, and the data is correct (matches the numbers in the array), something happens if the number entered in the masktextbox does not match any of the number sets in an array then another thing happens.The masktextbox so far only validates format and gets number only, however, I want the number entered to match whats in the array.

View 1 Replies

Program Hangs After Leaving Screen Saver Or Locking Computer?

Nov 15, 2011

Our program works fine, until someone locks the computer or the screen-saver pops up (but not ctrl+alt+delete). Once the computer is unlocked/the screen saver is closed, the application stops drawing everything except the title bar, and stops responding to input - it displays a mostly-white window which can't be moved or closed.(Example of application freezing - the mountains are from my desktop background)If we let it sit for about 5~10 minutes, it comes back to life, and doesn't hang again (even after locking the computer/screen saver popup) until the application is restarted.

View 9 Replies

VS 2008 IO StreamWriter -- WriteLine Leaving Blank Text File?

Jan 29, 2010

I'm trying to use StreamWriter to write to a text file; it creates the file fine, but when I open it up, it's still empty. I marked the code below where the writing action takes place.

vb Public Sub BHorse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BHorse.Click
Dim oMarketsReq As New BFExchange.GetAllMarketsReq
Dim oMarketsResp As BFExchange.GetAllMarketsResp
Dim BFWrite As System.IO.StreamWriter
BFWrite = IO.File.CreateText("C:Datamarket.txt")
With oMarketsReq

[Code]...

View 5 Replies

Leaving Trash Behind - Stop - Removing A Copy Of Program Shown On The Task Manager After Close

Jan 3, 2009

Need help removing a copy of my program shown on the Task Manager after I close.

I must kill a conflicting program that cannot share the COM port and then reinstate when myprogram ends. To reinstate I use: System.Diagnostics.Process.Start(conflictingPath & conflictingProgram)

In the last line of my Form1.Closed I try to end all with:System.Windows.Forms.Application.Exit()

Not working - each time I run this program it does kill the conflicting program, can do its dialing function and upon closing reinstates the conflicting program. But each time another copy shows under Task Manager.

View 3 Replies

Find Out Wherer A Mouse Button Is Pressed When Mouse Pointer Is Leaving A UIElement?

Apr 6, 2011

I've been working on a GUI in WPF which I'm fairly new to, having only used Windows Forms up until now. So far, my GUI is very simple: it contains two rectangles, each of which drops a shadow. The shadow creates an effect of rectangles "floating above the canvas" so to speak.

When one of the rectangles is pressed, the myRectangle.MouseDown event is handled such that the shadow goes away, thus creating an effect of the rectangle being pressed down onto the canvas, like a button.Similarly, when mouse button is released, the myRectangle.MouseDown event is handled such that the shadow reappears and the rectangle "floats" again. This behavior make them resemble buttons. Note, there a reasons I want them to be rectangles and not custom buttons.

[Code]...

If the pointer leaves a rectangle while mouse button is pressed, I'd like shadow to reappear. This is arguable simple, because theoretically in this case, any time myRectangle.MouseLeave is raised, the shadow should come back on, even if it was already there.If the pointer left a rectangle when mouse button was pressed, then came back while before the button was released, I want the shadow to disappear again. This one is what gives me problems. No idea how to do this.

View 1 Replies

Disable The Local Area Connection While Leaving The Wireless Connection Enabled

Jun 21, 2010

I am attempting to write a program that will disable the Local Area Connection while leaving the Wireless connection enabled. My company is using net-books in our stores to demo air-cards and we need to keep them off of the LAN. I'm new to VB and VB.net, and it's been a while since I did any type of programming. I've gathered some code that others have posted in forums and tutorials and I'm working through a tutorial book, but I finally believe that I am stuck.

[Code]...

View 4 Replies

How To Stop Leaving Form Without Knowing Exact Size Of Form

Oct 12, 2010

i was wondering i have a picture box which is controlld by the keyboard, and the picture is able to leave the form. i was wondering how to stop it leaving the form without knowing the exact size of the form and using multiple points on the edge of the form.

View 3 Replies

Set The Opacity Of A Form (not Form1) Down To 50% But Leaving The Buttons And TextBoxes At 100% Opacity?

Nov 1, 2011

How can I set the Opasity of a form (not form1) down to 50% but leaving the Buttons and TextBoxes at 100% Opacity?

View 9 Replies







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