vb.net

aspx td question

i have this code - <td id="td_h1" runat="server" style="background-image:url(images/img_new.jpg);vertical-align:top"> <div id="title_1" runat="server" class="caption" >This is New</div> </td> here's the problem - this is the code from the .master.aspx page. Some file access this master page from different folders, and some files from ...

Randomization involving buttons (VB)

Using VB I can create and access a random "cell" in an array like so Dim array(5) as array Dim r as new random r.next(0,5) array(r) will then access a random "cell" based upon r's value. Is there a way to say something like button(r) to directly randomize which button is chosen instead of having to use a random and If's like so? r.n...

ModalPopupExtender: Dragging dialog box results in 'scrollleft is null or not an object' error

I am using the ModalPopupExtender control to display a modal popup dialog when a button is click. The problem is that dragging the dialog results in an 'scrollleft is null or not an object' error. Here's a video demo ..and here is ALL the code: If possible, I'd like to resolve this problem w/o resorting to modifying the AjaxToolkit s...

Creating DB using ORM

Is there any C# .NET ORM that can create databases ? It should be capable of creating MS + MySQL + PostGre + Oracle databases at least. And I don't mean tables or schemas, I mean the database only. I use nHibernate, but it can only create tables and schemas, and query/insert but not creating the database itself. ...

VB.NET RaiseEvent, threadsafe?

Is RaiseEvent thread safe? In C# you write if (event != null) { event.invoke(); } and the C# code is not thread safe.... ...

Is it possible to distinguish types with identical fully qualified names?

The scenario is I would like to be able reference two similar 3rd party assemblies (e.g. assem1 and assem2) which both define a type with the same fully qualified name (e.g. Example.MyType). Is there any way to distinguish between these and refernce them seperately? I believe the answer is no but confirmation or correction would be handy...

Enterprise Library RangeValidator syntax

I'm trying to use the Enterprise Library RangeValidator attribute to validate that a decimal value is greater than zero: <RangeValidator(GetType(Decimal), "0.00", RangeBoundaryType.Exclusive, "1", RangeBoundaryType.Ignore, "MyMessage", "", Nothing, False, "", "")> _ Public Property Holding() As Decimal Get Return...

a = b = 5 in VB.NET - impossible?

Is it possible in VB.NET doing a = b = 5? (I know that = is a comparison operator too) I mean do not result (if b = 2 by e.g.) a = false b = 2 HOW to do it, however, in situations like bellow? The inconvenient caused this question in my code: some objects a, b, .. z are passed by ref in a method, if I don't initialize them compile...

Function return System.IO.MemoryStream?

Hi! I trying to display image in picture box. The application have two part. First part is windows application, and second part is web service (asmx). This is the code for windows application: Public Sub PrikazSlike() Dim p As localhost.Service1 = New localhost.Service1() PictureBox1.Image = Image.FromStream(p.Pic...

While loop causes the app to go slow? Any idea why??

Hi, I have a simple code that looks up a text file, reads the line of text, splits the string by semi-colons and then posts the results. After it has done this, I have created a really simple while loop to waste 10 seconds before going for it again.... here is the code: Private Sub checkTemps() While Abort = False Try ...

using tapi to monitor multiple phones and dial or hangup

I have with a good level of success got a C# application to use TAPI to connect to my office PBX and dial and hangup calls but need to go further and be able to monitor activity and provide CTI to client pc's as well as integration back to my companies web based CRM. I am focusing on the client app for CTI popups and dial/hangup functio...

dynamically increate the listbox column width with form resizes

I want the ability to auto stretch the listview control column when the form gets resized in vb.net 2008 These are the properties I am mentioning for the ListView now : ListView1.View = View.Details 'ListView1.GridLines = True ListView1.FullRowSelect = True ListView1.HideSelection = False ListView1.Mult...

Is it possible to change a component name in a component designer in WinForms .Net

I've created a component whose name I'd like to be able to change while editing in the component tray. I've added a Designer action for a name property, but now I'm stuck. Looking at the property grid, I can see that the name property is parenthesised, indicating that it's not a regular property. Is this possible? ...

When "OR" is better than "ORELSE" in VB.NET ?

Hi all ! My doubt is about OR and ORELSE. There is any situation where OR is better to use than ORELSE ? And if not, why they don't just "upgrade" de internal code ? Cheers !! ...

Create a dropdown list of valid property values for a custom control

I've created a custom user control that has several properties. One specifies which database I want the control to access. I want to be able to present the user of the control a drop down from which he can select which database the control will interact with. How do I get the dropdown to work? I can get default values, but have yet to ...

(VB.NET + WPF) Drag + Drop (to allow user sorting) of stackpanel elements within a Scrollviewer?

I have good model (I think!) for how to allow a user to drag an element in a stackpanel and reposition it to another location within the stackpanel. However, my Stackpanel is placed within a ScrollViewer, like this (generalized): <ScrollViewer> <StackPanel> ....First item ....Second item ....Third item ...

get length of data sent over network to TCPlistener/networkstream vb.net

It seems the most obvious thing, but I just can't work out how to get the length of bytes sent over a network using a TCPClient and TCPListener? This is my code so far: 'Must listen on correct port- must be same as port client wants to connect on. Const portNumber As Integer = 9999 Dim tcpListener As New TcpListener(IPAddress...

Difference between 32bit <> 64bit and serial communication

Hi, I'am using the Rs232 Class Library in a vb.net application to print text to a POS printer. in the last week some of our clients have upgraded their system to Windows 7 x64 bits versions and start to fail when they print text via COM to the printer. Can anyone help me regarding this? Is there anything special you have to do with a 64b...

Masked Text Box removes preceeding zeros in date

I have a process which grabs the birthdate and from a data table and display them in a masked text box for viewing and editing However when pushing the data into the textbox any preceding zeros get removed For example 05/05/2005 would display as 55/20/05__ The masked Text box is set up as 00/00/0000 The line which assigns the code is...

Setting fileIOPermissions for saveFileDialog

I have always had trouble in this area. I am running on Vista, and I have an application I am developing that needs to be able to save a file anywhere the user selects (i.e. 'c:\'). I can call the savefiledialog, but I always get a permisisons error (even though I'm an admin on this machine) when I select the root folder. How do I g...