Mocking The Raising An Event In Vb10

Nov 25, 2010

I'm trying to use mockling with VB10(VS2010) to improve my unittesting. I have a C# lamda expression example but I don't know how to implement this in a VB lamda expression? v => v.Load += null The full Moq to raise the load event would be view.Raise(v => v.Load += null, EventArgs.Empty) .Net Developer

View 1 Replies


ADVERTISEMENT

Multithreading And Asynchronous Event Raising

Jan 17, 2012

I am developing a form application in VB .Net with a main thread and two other threads that reading values from two serial ports, do some work and raising events to return values when each thread ends.The handlers for the events are in my main thread.Is there any possibility the two threads to raise events the same time or some other event (button click event for example) raised the same time with a thread finished event? What happened then? Is there a way to make asynchronous event raising?

View 11 Replies

Raising The Same DoubleClick Event For Different Controls?

Jul 16, 2009

I am using Visual Basic 2005 Express and have 8 PictureBoxes on the Form.. When the user Double-clicks any of the Picture Boxes, the path of the image needs to be passed to a Subroutine..As of now, I have a different event for each of the PictureBoxes.. I was wondering if there is a way such that I can use a common event. i.e. if a user double-clicks on any of the picture boxes, the same event is raised ?

View 3 Replies

Wpf - Raising Event In Custom Control?

Dec 8, 2009

I'm writing a custom textblock control thats populate hyperlinks and raises event when clicked to hyperlink.

I wrote this code but I got stucked.

My code is :

Imports System.Text.RegularExpressions
Public Class CustomTextBlock
Inherits TextBlock

[Code]....

This code gives error at RaiseEvent Klik(sender, EventArgs.Empty)

Error is : Cannot refer to an instance member of a class from within a shared method or shared member initializer without an expliticit instance of the class.

View 2 Replies

Code Syntax - Raising Event Have Error

Feb 12, 2010

I am facing issue in following code syntax...

Protected Overridable Sub OnHeaderClicked(ByVal args As ItemSelectedEventArgs)

If ItemSelected IsNot Nothing Then

RaiseEvent ItemSelected(Me, args)

[CODE]...

View 6 Replies

Raising An Event Every Time A Form Is Shown

Apr 19, 2012

The MyBase.Shown event only gets raised the first time a form gets shown. How do I make something happen every time the form is shown?

View 2 Replies

[2008] Raising An Event Before Loading Data

Jan 7, 2009

As it stands, when I click a button to load the data the application lags and looks as though it has locked up although it has not. There are a lot (10,000) of records to load in some cases.

I thought I could just change my status strip text to dispay "Loading database" while it's loading.

So, I raise an event (dbloading) in the "load db" button.click event before calling the procedure to load the data. When that event is raised, I change the status strip text.... but it does not work.

Here's my

Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoad.Click
jnATM = Me.atmJobNum

[Code]....

View 6 Replies

Asp.net Vb User Control Raising An Event On The Calling Page

Apr 7, 2010

i'm trying to learn about user controls. I created a user control that has a textbox and a button. What i'd like to be able to do is when i click the button in the user control, populate a label in the aspx page. I understand that i could just have a button on the page that uses some properties on the user control to get that information.. but i'd like to know how to do it with the button the user control.. the reason for this is the button is just an example.. a learning tool. if i can get this working, i'd likely be putting thing in the user control that might require this kind of passing information. Anyway.. i've found some c# examples that i tried to get working as vb.. but once started getting into the delegates and events..

View 3 Replies

Asp.net - Raising An Event Inside A User Control That Returns CommandEventArgs?

Dec 5, 2010

i have the following problam: i have a user control which i want to raise an event from to the page that is using that user control (its a button)anyway my problem started when i wanted to put this user control inside a repeater instead of another button (regular asp:button)anyway i needed to support CommandArgument so that page can use the button,so i created a property:

Private m_CommandArgument As Object
Public Property CommandArgument() As Object
Get[code].....

so after i press the button and the postback happen my raised event dosnt have a value..where should this property be saved in order for it to have a value after postback? view state? how do i add to the the viewstate automaticly?

View 1 Replies

Raising Events With FakeItEasy In .Net To Verify That Event Handler Is Wired Properly?

Apr 27, 2011

I am attempting to test that the event handlers between an interface and controller are wired properly. The system is set up like the example below:

[Code]...

View 1 Replies

Two Objects That Are Raising Some Events - Pressing A Button - Raise A Custom Event, Then Execute A Method And Then Close The Form

Mar 30, 2011

Problem that you may have when dealing with two objects that are raising some events. Here, to make it obvious, I am closing the form, but the problem can be experienced with any other 2 classes event. First, what is the problem !

Let suppose that by pressing a button, you want to raise a custom event, then execute a method and then close the form

In that case, you may use a code similar to this

Event BeepIt()

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
RaiseEvent BeepIt()

[CODE]...

View 14 Replies

Unit Testing - Mocking Methods With Moq

Jul 21, 2009

I am trying to unit test a controller action that uses the membership provider to update user details. I am using Moq which so far has been easy to use. The problem is I can't seem to get it to mock calls to methods that don't return anything.

[Code].....

View 4 Replies

Fading In/out A Text Box In VB10?

Jun 2, 2010

Anyone got any ideas on how i would go about fading in/out a textbox? Because only forms have opacity properties i was thinking of something like setting the background color to transparent and setting the forecolor of the text to the same as the background color. Then using a timer i could slowly change it to black, etc.

View 7 Replies

Horizontal Scroll Bar In VB10?

Aug 30, 2010

Is the Horizonatal scroll bar an available tool in VB10. If so where is it?

View 5 Replies

How To Add Items To A String In VB10

Dec 1, 2011

I am writing a program for my intro to programming class. we have to make a bar chart using asterisks to show the bar items. he said we have to use nested loops. that i understand, but i can't figure out how to add the asterisks into the string without causing them to all be on separate lines.

View 3 Replies

Replace A File In Vb10?

Jun 24, 2012

I want to Replace a file with another in vb 10.

1)when Anyone click a button it will open a open directory.then it have to replace the file they choose with mine.

2)i need the code

Dim as new openfiledialog

View 5 Replies

Change AxShockwaveFlash1 To ShockwaveFlash1 In Vb10?

Jul 1, 2010

how do i change AxShockwaveFlash1 To ShockwaveFlash1 in vb10

View 1 Replies

Class Library For The Matrix In VB10?

Apr 15, 2012

is there a library for the matrix like the library of the complex numbers for example?

View 2 Replies

Graphing And Rotating An Array Using VB10?

Apr 16, 2012

I had an assignment that I had done, which has been turned in, I was able to get it to graph, but it when it reaches the right side of the screen it drops off, when it is is adjusted using the velleman controls it jumps back up, hw would I fix this.

Here are the instructon for the assignment:

Write a program tat rads two analog inputs from a velleman board and plots the values on a rotating graph. The number of value plotted horizontally should be specified in a text box. Label the graphs vertical values in at least three places. Print the current voltage reading for each input in it's own lable. The graph should auto scale to fille the graph vertically and horizontally.

The two things that I couldn't get to work is the graph drops off the chart and I was unable to place the vertical values in three places.

Here is my code:

'Date: April 10, 2012
'Progammer: Cathy Hjelm
'Progam: wk8-1

[Code].....

View 3 Replies

Stay With VB10 Or Upgrade To VB11?

May 21, 2012

The title basically says it all. What are the main differences between .NET 4.0 and .NET 4.5 and is it worth upgrading to .NET 4.5?Jordan St. Godard |Microsoft® Community Contributor 2011

double twoCents = .02;Console.WriteLine("$" + twoCents.ToString());

View 9 Replies

VB10 Not Picking Up Access Database?

Dec 6, 2011

I have just opened VB10 for the first time and it converted my VB8 program beautifully, except that all of the screens are not showing any data !

My reference to the MS Access database file is as follows :-

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:MoneyMoney.mdb"

Do I need to change any of this syntax or is there some other reason why VB10 won't show anything ?

View 19 Replies

VB10 Set The Width Of A Form In Inches?

May 27, 2011

How can I set the width of a form in inches (or cm) instead of pixels?

I want to print the form, so it needs to always be the same dimensions (4" by 6"). I saw some examples for previous versions of VB, but nothing that works in VB10.

View 3 Replies

VB10, Auto-Implemented Properties And COM?

Nov 30, 2010

I recently finished a class that we're using to tie Access to some WCF Services. Of course this means that the .Net classes (and all of their properties) need to be visible to COM. Given that I'm using VB10 and the Contact class has about 20 properties I went ahead and used auto-implementing properties.Much to my surprise, the properties were not accessible from within VBA in Access. I tried marking the properties as ComVisible (which I didn't have to do in the past with standard properties) and it still didn't work. After changing the auto properties to standard properties everything worked.

Became
Public Property FirstName As String
Get

[code].....

View 1 Replies

Add Delete Or Update Record In Access Using Vb10

Feb 10, 2012

i am working on a project in vb10 i want simple code to add delete or update record in ms access by a click of button

View 10 Replies

Blue Screen When Closing VB10 Application?

Mar 8, 2012

I am developing a simple application in VB10 that uses ADO.net to store data in an Access database, and gets input via a serial port RS232. It works well, but is not fully debugged. Unfortunately, a problem has recently started where as soon as i close the program I get a blue screen. Makes it hard to debug. The solution does not even have to have run; it just has to have been loaded and then exit VB10. The blue screen aslo happens to most of the other example solutions that I have downloaded.

Questions:

1)How do you capture the STOP error codes (probably stupid question)?

2) Is there an easy solution that rings a bell? My IT support is trying but not getting anywhere. Have to believe it is hardware related, but the hard drive checks out with testing.

View 2 Replies

Determine The Length Of A String Variable In VB10

Mar 6, 2012

I try to determine the lenght of a string variable, but get the wrong outcome when using: testje = Len(testSTR). When I insert the following line of code: testje = testSTR.Length the answer is still wrong but when I click "Length" I see the correct value. How to get at that value, so I can use it?

View 11 Replies

Disabling Edit-and-continue In Vb10 Vs2010?

Jun 8, 2009

I've been using the vs2010 beta but I can't seem to get edit and continue to work.

Compile -> Advanced Options -> Target platform is set to x86 (Compile -> Platform is disabled and set to Active (Any Cpu)?).Options -> Debugging -> Edit-and-continue is checked but grayed out. Presumably for the same reason I can't debug.Options -> Historical Debugging is set to Events Only. Disabling it doesn't help.I get no warnings when trying to modify files while debugging, they're just read-only (shows a lock icon in tab).

What are some other options that might be disabling edit-and-continue?

View 1 Replies

Increase The Diameter Of The Sphere Of Radio Buttons In VB10?

Dec 19, 2011

can I increase the diameter of the sphere of radio buttons in VB10?

View 2 Replies

Extract Data From Excel Sheets And Write In Database In VB10?

Oct 1, 2011

I want to read data from excel sheets and write into tables in database visual basic 2010. I am usinq Oracle 9i for database.and my objective is that user should select excel file and if button is pressed then I want to extract data from excel sheet and store in a already created tables.

View 5 Replies

Raising Events And COM?

Jul 22, 2009

I have a windows application which raises a particular event.I need to create a COM callable class whic will allow VB 6.0 to subscribe to this event.I have done a fair amount of research on this and am confused as hell.

View 3 Replies







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