Use Dynamic Key Value With Switch-regex?

Mar 27, 2010

$source |% {
switch -regex ($_){
'<'+$primaryKey+'>(.+)</'+$primaryKey+'>' {
$primaryKeyValue = $matches[1]; continue; }
}

I want to use dynamic key value with switch-regex, is that possible?

View 1 Replies


ADVERTISEMENT

Use Regex To Find A Dynamic Text?

Nov 29, 2009

I'm needing to use Regex to find a dynamic text. It will always be found between the same things. Now, I'm sure that made little sense, so let me clarify. I have a rich text box full of text. I am needing to use a Regex method to find a certain string of that text that is always different. This string will be located between the same two pieces of text every time.

For Example: If this is my string: id ="user_name" ><img style ="display: block;" usr ="resentful" I need to find the text in between id ="user_name" ><img style ="display: block;" usr =" and ".

View 5 Replies

Concatenating A Variable With A Regex Group Match In Regex.replace?

Apr 5, 2012

I am having an issue where I am using regex.Replace to replace part of a string. The basic idea is that I want to capture the beginning of the string then replace the end of the string with a value from code. For an example pretend I have a string that says "Test Number " followed by number and I want to increment that number. I capture the "Test Number " but when I try to concatenate that capture with the new number it treats the capture ($1) as a literal and replaces the entire string with $1[new number].

[code]...

This will output "We are on Test Number 2", as expected. how I can use a variable in the replacement string portion of the Regex.Replace when including a captured group?

View 1 Replies

Regex: Take Text & Some Special Characters Between The Xml Tags Using Regex On C#.net?

Feb 23, 2012

I want to take the text and some special characters between the xml tags.. My input file contains:

[Code]...

now i want the Regex to take text and the special characters between the tags <line>,<inline>..

View 2 Replies

Increment Regex Match Using Regex.Replace

Jun 21, 2012

I'm creating a program in VB.NET to output multiple images. Some images will have the same file name. If there is multiple files with the same name I want to add "_1_" to the end of the file name. If the "_1_" file already exists I want to increment the 1 to be "_2_". If this file already exists I want to continue incrementing the number ultil it doesn't exist. So for example "filename", filename_1_", "filename_2_", etc. Here is the code that I have tried

[Code]...

View 1 Replies

Regex Builder That Actually BUILDS RegEx From A Highlight

Nov 17, 2011

I've been working straight since yesterday trying to get this to work. I'm a noob to RegEx and I've tested out about 5 different RegEx "builders" but each of them require you to navigate through the options to build the Regex...each of them has failed when I try to use them.Is there an application out there free/paid where you select the line you want to grab and the RegEx is auto generated from that highlight rather than having to try to build the line of code? [code]

View 1 Replies

Access Values Of Dynamic Controls Added To Dynamic Tabpages?

May 8, 2011

i have created a dynamic tabpage and a dynamic tablelayoutpanel inside it then added dynamic textboxes and labels inside the tablelayoutpanel...the thing is , i am having a problem on how to access the value of those textboxes and labels and add them as new columns in the new table(tagpage) in mysql database, i can already create the table in the database but i cant add the new columns in it. heres the code for accessing the values of the labels and textboxes

error: NullReferenceException was unhandled....Object variable or With block variable not set.

sql = "alter table " & tbl_selected(counter) & " add " & frmMain.Controls("TLP_" & SecArrList_sp(counter2)).controls.item(SecArrList_sp(counter2) & "label" & counter).Text & " varchar(100) NULL;"

View 2 Replies

Dynamic LINQ Query Based On Dynamic Number Of Comboboxes?

Feb 5, 2010

I would like to bind a DataGridView to a different LINQ query every time (in order to reuse the same form/DGV for different queries), like this:

[Code]....

but the "Qry", and the number of comboboxes, and their field names would change every time.

View 5 Replies

VS 2010 MDITAbControl Add Dynamic TextBox With Dynamic Webbrowser?

Feb 29, 2012

Basically i have one TabControl with a form and 2 browsers within one form I have ProBlem To call the dynamic browser to navigate with dynamic Textbox.text

[Code]...

View 6 Replies

Dynamic SQL To Dynamic LINQ In .NET With MS SQL Server 2008?

May 24, 2010

I need to represent the following query using LINQ:

DECLARE @PurchasedInventoryItemID Int = 2
DECLARE @PurchasedInventorySectionID Int = 0
DECLARE @PurchasedInventoryItem_PurchasingCategoryID Int = 3
DECLARE @PurchasedInventorySection_PurchasingCategoryID Int = 0

[code]....

Now, I know that a query in .NET doesnt look like this, this is my test in the SQL Design Studio. Naturally VB.NET variables will be used in place of the SQL local variables.My problem is this: All of the conditions after "WHERE" are optional. In that a query might be made that uses one, some, all, or none of the conditions. V.PropertyID and V.Value can also appear any number of times.In VB.NET I can make this query easy enough by simply concatenating strings, and using a loop to append the "V.PropertyID/V.Value" conditions.I can also make a Stored Procedure in MS SQL, which is easy enough.However, I want to accomplish this using LINQ.

View 2 Replies

VS 2008 Dynamic Timer In A Dynamic Form

Feb 19, 2010

Ive managed to dynamically create a form, and dynamically create a timer, but i have not been able to create the timer on the dynamic form. Specifically, i need to be able to have the timer itself create another form with a timer. (I realize that this would create a new form every interval on the timer, that is what i want to do)

1. A way to add the timer to the dynamic form, and maintain the timer sub on my main form.

2. A way to create the whole thing over (dynamic form and timer) through the previous dynamic form and timer.

I was thinking i could use a collection/array to store the forms and timers, but i'm still having trouble figuring out how to add entire forms or timers into a list. (A timer is not considered a control, so i cant use a controlcollection...)

Heres my code;

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim frm As New Form

[Code]....

*EDIT* Btw, my idea was to use i as a variable that increases every time a form is created, then insert the form into the array, with i as the integer. i just need to know how to create a new form with a different name each time. (as with timers)

View 1 Replies

Dynamic ContextMenuStrips On A Dynamic Form?

Oct 15, 2009

I have a form that i need to be 100% Dynamic. So it could contain 10 labels maybe 100 who knows.

When you hover over a label there will be a different contextmenustrip to appear for each and every label. So all the contextmenustrips are Dynamic and contain 1 option maybe 2 options even 3 or 4 up to the users settings.

My problem is not creating a handler for when the user clicks on the contextmenustrips options. The problem is knowing which one of the options for that contextmenu was clicked!!

View 1 Replies

Dynamic ToolTip For Dynamic Text Box?

Jan 11, 2012

OK, I'm trying to display tooltip text for a dynamic edit box. Well, at least I'm trying to.

On my form, I've got a tool tip control which I've conveniently named ToolTip. My edit box displays OK. But, what I want to do is when the user hovers their mouse over the text box, I want the tool tip to display some text.

I think there are two problems that I'm having. I'm not convinced that I'm properly addressing a dynamic text box name. Ideally, I would want to be able to refer to the text box (but using a dynamic variable that will contain the prefix of the name). To hardcode, I would want to be able to achieve (not in this example but in theory): ABCDEFGt_0300.Text = "hello"

Dim controllerName as string = "ABCDEFG"
Dim t_0300 As New TextBox()
Me.Controls.Add(t_0300)

[Code].....

View 12 Replies

How To Switch Between .NET And C#

Apr 23, 2012

how to switch between VB.NET and C#. I need this information because I have a project that needs application building and the programming language is C#.I found a good sample program on the Internet which uses an SDK called Ozeki SIP SDK.

View 1 Replies

C# - Switch Case In VB

May 19, 2012

This is my vb.net code:

[Code]...

View 2 Replies

How To Switch A Large App From VB6 To .Net

Nov 5, 2009

Exact duplicate: How to switch a large app from VB6 to VB.Net Exact duplicate: Best strategy for moving applications from VB6 to VB.Net Exact duplicate: Conversion tool comparisons for VB6 tool which converts vb6 to vb.net

View 5 Replies

How To Switch Forms

Apr 28, 2010

I am using Visual Studio 2010. I have a Splash Screen which starts first (Everything is running smoothly there). Then it Opens Dialog1. My user is required to check 5 boxes (2,3,4,5,6) (1 has been deleted). I used this Code :

If
CheckBox2.Checked
And
CheckBox3.Checked And

[code].....

I've been experimenting for an 1 hour. The code didn't show errors. I tested it and it didn't work. Then I found out that I was working on Dialog 2 in Dialog 1 code. So I tried another thing and that didn't work because I can't put Dialog2 code in Dialog1 code.

View 2 Replies

How To Switch Machines

May 28, 2012

I have two machines, on the first of which I have developed my application to a point of satisfactory stability. Now I want to move everything to my second machine.Both computers have the same level of XP and NET Framework code, and both have Visual Studio 2010 at the same level.I copied my application's project folder onto the second machine, but the second machine's VS 10 can't load the project because it can't find a couple of Interop files (e.g., AxMSComCtl2). All of files are present in the project folder and also in its.bin subfolder. The only observable difference between the two machines is the presence, on the first machine, of some Assemblies stored under my user name there. Copying the Assemblies to the second machine didn't help (I hadn't thought it would).Is my application permanently "imprinted" on my first computer, or is there a simple way of resusitating its clone?

View 10 Replies

How To Switch Users

Jan 3, 2009

How to switch from users A to user B in visual basic? User A should not log off.

View 3 Replies

Switch Between Different Forms?

Sep 27, 2011

I always get an exception when I try to switch between different forms in my program. Here is the exception message:

Control.Invoke must be used to interact with controls created on a separate thread

I have attached the forms to very nice variables and this problem occurs when I try to use command like MyForm.Show().

It does not happen when the forms are not attached to variables, but then I have collosal problems with refreshing the textboxes and stuff.

edit;

I have 4 different forms. When I load the main module and main form, in the Sub (...) Handles MyBase.Load I execute the following code:

In module:

Public StartupForm As frmStartup
Public RegularForm As frmRegularUse
Public LoginForm As frmLogin

[Code]....

This is the aproach I worked out to get the full control over refreshing the forms. It is a program for Motorola Scanner with Windows CE. Now, for example, when I enter the correct password in LoginForm, I want to switch to the RegularForm. When I try to use RegularForm.Show() or RegularForm.ShowDialog or RegularForm.BringToFront(), I get an exception. When I try to call the form with the frmRegularUse.Show() I can call the form, but it is being created in a different thread, I believe, so I loose control over it (when I try to put something from the keyboard, there is no response).

View 2 Replies

Switch Between The Windows?

Jul 30, 2009

I'm creating a wizard kind of Windows Application. I've to show up the next window on click on "Next >" of every window.

FYI, I cannot use MDI architecture.

What is the best way to achive that?

Right now, I've put the following code on Next Click of every Window.

FormNext.Show()
Me.Hide()

View 2 Replies

Switch Code On And Off?

Jun 1, 2012

I have some code for my DGV Cell painting event:

'Private Sub DataGridView1_CellPainting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellPaintingEventArgs) Handles DataGridView1.CellPainting
' If e.ColumnIndex <> 1 Then Exit Sub

[code].....

View 2 Replies

Way To Make A Switch

Nov 11, 2009

VB.NET is good for me, because it is simple and its not complicated and you don't need to be so strict with syntax. I want to switch to C# but I just don't feel up to it because of the syntax and C# being so strict. What are some good reasons to switch to C# and what will make the transition easier?

View 7 Replies

C# - Switch Between Two Apps Seamlessly?

Jan 17, 2012

I have a .NET application that was written in C# and VB.NET using WinForms. We want to slowly migrate this to something new, in many iterations. The new code will be entirely C# and WPF. We would like to utilize Prism.

As far as I know, we can't integrate the old WinForm app in Prism.

I am considering making my old app show the new app in certain instances. For example, when you press a tab in the old app, the new app opens on top of the old app, with the same tabs. Over time, only the new app would be necessary.

View 1 Replies

Hangs When I Switch To Design ?

Aug 21, 2009

I have downloaded SP1 and installed it,I have an applciation with 10 form and numerous classes and dialogs. When I right click a form in the soultion Explorer window and choose view Designer VS hangs for anything upto 10 mins. Is there anything that I can disable/ enable to stop this hapening. The only Language that I will be developing in is vb.net.

View 10 Replies

How To Avoid If ... Else And Switch Cases

Aug 3, 2010

I have been programming for alot of time. Generally i program in some languages like PHP, ASP.net, Java, JavaScript and others. In all languages i have to use alot of if else statments . Like if value= 10 then ... if i review my code then i find alot of if conditions. So i would like to minimise them but how not sure. one point was using classes somewhat minimised but still they are more... like task, cat, sec and type:

[Code]...

View 9 Replies

How To Switch Between Form In Runtime

Jan 5, 2010

How to switch between form in runtime

View 5 Replies

How To Switch Between Forms In VB 2010

Jan 21, 2010

I have a form (form1.vb), but i want it to be able to click a button (I already have it) and display another form (IEclick.vb)

View 2 Replies

How To Switch Between Two Form Using Buttons

Aug 10, 2010

In my program I want to have two different 'modes', each has its own form. My main form in the program is 'Normal Mode', but there is also a mode called 'Basic Mode' which has a smaller form. How can I switch between the two forms (using buttons) by closing the other without my program closing on me?

View 6 Replies

Monitor A Switch Using LPT Port?

Jun 12, 2010

How can I monitor how many times a switch open and close? I am planning to add a label13 to my form and use the LPT port so every time the switch goes high (1) it will add 1 to my label13.text. The Printer Adaptor address in the target PC is 0x378. using pin 10 (ACK) or pin 2 (D0).

View 16 Replies







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