vb.net

Global variable scope issue

I have a vb.net (I am new to vb.net) site that is supporting 10 languages and 30 or 40 countries. I have it architected so that all the files that contain content are located in a inc folder located at root and are called into my container files via Response.WriteFile. My plan is to make the paths the the container files dynamic and set ...

VB.NET - New text editor? (Syntax Highlighting and Syntax Extraction)

Hi SO, I'm thinking of developing a more efficient version of the Rich Text format but I need to know a little about Syntax Highlighting and Syntax Extraction. Like when reading the file, read all the {Property Boxes} and use them in a RichTextBox. Ex: {C=0000FF}Hello world!{/C} Prints "Hello world!" in red. This would also be good to ...

AndAlso/OrElse in VBA

Hey I'm trying to get a lazy evaluation 'And' in my my Excel macro to do something like: If Not myObject Is Nothing *And* myObject.test() Then 'do something' Else 'do something else' End If I know this exists in VB.NET as AndAlso and OrElse but cannot find anything similar in VBA. If this actually does not exist what's the b...

Replacing a string with array's data based on array's index

Hi all, i have an array contains a-z. Then i have a textbox and when click on the button, it will replace the text inside the textbox to the index number of the array. Example, from "abc" will become "0 1 2" The code below do the job. May i know how to do so that i can replace the text inside the textbox from "0 1 2" back to "abc" based ...

Select distinct rows from datatable in Linq

I am trying to get distinct rows based on multiple columns (attribute1_name, attribute2_name) and get datarows from datatable using Linq-to-Dataset. I want results like this attribute1_name attribute2_name -------------- --------------- Age State Age weekend_percent Age statebreakl...

ASP.NET Language Toggle

Hi, I'm able to change the language for my pages, however if I select french and I am on a current page and if I try to load another page, that page won't be in french. How can I set it so it is consistent throught? Toggle Button in master page: If Page.Culture = "English (United States)" Then Response.Redirect(Re...

problem connecting with odbc mysql in vb.net

I'm trying another method to connect mysql and vb.net. I didn't have any difficulties connecting mysql and vb.net when using mysql net connector. And I also used the same codes. I just replaced the ones that needed to be replaced with odbc. Imports System.Data.Odbc Public Class globalclass Private cn As New OdbcConnection("DSN=k...

How to stop multiple dialog boxes displaying?

I have a very annoying problem and I'm trying to find the simplest solution possible, but I seem to keep complicating it. My program displays a custom dialog box using the ShowDialog function (I create this form using a New constructor), but while my program waits for input in the dialogbox, my program continues to run other code, (I'm...

how to convert "system.object" {string} to integer

hi guys, I am trying to read and write values in registry. I get return something like "system.object"{string} from reading function. I need to assign the value to a integer variable. How can i do it? ...

how to create a hierarchical datastructure just like xml using .net?

hi, i want to crate a hierarchical data structure same as XML, means parent, child, sub child... like that one using vb.net. so ho can i create that one? ...

Grid View - Do I Need ViewState for Nested Controls

I have a grid view with a nested text box in it. I would like to turn view state off but the fact of the matter is when data is posted, the text boxes inside the gridview aren't available (there are no rows in the gridview on postback). I am using ASP.NET 2.0 so would this fall into control state, not view state? Sample ASPX code of t...

Are arrays really fixed length in ASP.NET 2.0?

If I dim an array to say, 5 elements, should it not fail if I go to add a 6th? I thought this used to require a redim. In .NET 2.0, I have a character array of length = 3. When I populate it from the db, one record had 4 characters in it and it successfully added all 4 characters to the array? ...

Reporting Services - handling an empty date?

Hey, I have a report parameter which looks like this: 01.01.2009 00:00:00 Its a date (as string), as you might have guessed :). The problem is, this param can be an empty string as well. So I tried those expressions: =IIf(IsDate(Parameters!DateTo.Value), CDate(Parameters!DateTo.Value), "") =IIf(Len(Parameters!DateTo.Value) > 0, CDate(...

How to handle events of members from another class/instance

I am attempting to share a sub menu among several different parts of an application so that it is consistent (not wanting to copy/paste.) I thought it would be simple. I am doing something like this: public class MyClientClass Private WithEvents ctx As ContextMenuManager = New ContextMenuManager Private Sub handler() Handles ...

pick up value from textbox after receiving it on the submit page in vb.net

i have 2 aspx pages. first one has two hidden input fields as follows. input id="ad" name="ad" type="hidden" value="<%=Request.QueryString("ad") & "" %>" /> input id="bd" name="bd" type="hidden" value="<%=Request.QueryString("bd") & "" %>" /> Now when this lands on the next page, I need to pick up these values, so basically - dim a1 as ...

Conversion error in vb.net?

I am puzzled by why it does not retrieve the data and keep saying i have a error "InvalidCastException", i am currently doing these in compact framework and is totally new to it, i searched around looking for a way to get data into a listview base on what little i know about java . these are my creation of table and inserting during form...

vb.net setting background color of a form

Private Sub HScrollBar1_Scroll(ByVal sender As System.Object, _ ByVal e As System.Windows.Forms.ScrollEventArgs) _ Handles HScrollBar1.Scroll Me.BackColor = HScrollBar1.Value End Sub How can I set the BackColor of the form? How can I use an RGB value? ...

How to Clicking "X" in Form, will not close it but hide it

how can i make my Form not to close but to Hide when user click on the "X" button on the form? As i have a NotifyIcon that contain an Exit menu which actually does the Form Closing (i don't want the Form's "X" to close the form but to hide it). thanks. ...

IE6 opening XLSX file as an XLS file

My application generates XLSX files based on a users requirements. After the XLSX file is generated the user is redirected to where the file is saved using Response.Redirect... Response.Redirect("filename.xlsx") When the user then opens the file... they recieve this message. The file you are trying to open, 'filename.xls', is in a di...

VB.NET - HoW to get audio levels from AudioVideoPlayback.Audio?

Trying to make a tiny app which plays an audio file, and I have designed 5 vertical progressbars for monitoring the left, middle and right channels of the audio file (the middle just being an average between the left and right channels) just for a fancy look. Can someone help me read the audio levels(decibles or whatever) of the audio fi...