.net - Substitute/disable Control Components For Development/testing?
Feb 2, 2012
I have a VB form that contains controls for interfacing with some hardware (video cameras, motors, etc) on the machine it is to be deployed on, but I'm usually not at the location of said machine (it's a 3-hour drive away). I'm trying to work on the project while on my laptop, but obviously the controls will generate all sorts of errors since they can't talk to the hardware.
I was thinking of replacing the control types with my own mock control classes, then use #if directives to control whether I'm building for the real machine or my test machine. Problem is, some of the affected code is in the form designer-generated code section; the form designer automatically tries to "correct" my changes, so I'd have to manually put them back all the time, and try to remember not to commit the form designer's edits into version control.
View 2 Replies
ADVERTISEMENT
Mar 25, 2010
I'm using .NET 2.0 Windows Forms and want to add "drawing" components such as lines, rectangles, etc.. I've done this before in MS Access, but I can't seem to find similar things in teh Visual Studio 2005 IDE. Where do I need to look to find these elements?
View 2 Replies
Aug 15, 2009
I was wondering if there were any free ribbon controls for vb.net, and if there are not, how I could go about making my own. I don't want to pay $300 or more for a professional one...and I would really like to add one to my project.
What would be the best solution for finding/making one?Here is my google search I tried, I could only find one for c#. If possible, I would like one which is the closest to the one used in Office 2007.
View 2 Replies
Feb 21, 2010
I am building an application in VS2008 (VB.NET) that contains several user controls. When I was developing under VS2005, all the components in my application would load into the toolbox so I could access them during design.
Since upgrading to VS2008, however, those application-based components do not load, and I cannot access the user controls I have built.
1. Exit Visual Studio
2. Navigate to %USERPROFILE%AppDataLocalMicrosoftVisualStudio9.0
3. Delete the TBD files found there (these are hidden by default)
4. Re-start Visual Studio and open your WPF application - the toolbox will now be reinitialized
and that worked for one session, but it did not get preserved -- when I shut down and came back into VB.NET, the application-based controls no longer loaded.
Is there some setting in VS2008 that I am missing? Or is there another step to getting the app-based controls to reappear each time I load the development files?
View 14 Replies
Feb 24, 2009
I'm using the webbrowser control in VB.net. I want to click a button and have the webbrowser go to a certain website (done). Then I want it to wait a period of time and then do something on the page its on. The part I'm having a problem with is the waiting period. In the main form I have no problem manipulating controls or anything like that.
One solution would be to use thread.sleep() but that locks the ui and I don't like that. What I am trying to do is have a backgroundworker do the waiting then perform the necessary actions on the webpage, but the backgroundworker isn't able to access that thread, makes sense. I've explored delegates but that doesn't seem to do what I want as it doesn't allow me to put the background thread to sleep before it does its work.
View 2 Replies
May 15, 2009
I'm looking into adding some unit tests for some classes in my data access layer and I'm looking at an update routine that has no return value.It simply updates a row based on the id you provide at whichever column name you provide.Inside of this method, we collect the parameters and pass them to a helper routine which calls the stored procedure to update the table.Is there a recommended approach for how to do unit testing in such a scenario?
View 4 Replies
Apr 19, 2012
I get the idea of using namespaces to organise classes and code.What I am struggling with is how to use them when developing custom controls and components.using a seemingly arbitary root namepace for a set of related classes.
Namespace MikeCon
Public Class MCButton
Inherits Button[code].....
And is there a 'right' way, or at least a 'better' way of setting up the namespace, i.e how best to use the Project Properties Root namespace and the Namespace statement in code files to get the outcome you want when developing custom controls and components?
View 2 Replies
Feb 8, 2011
I have created a User Control in VB 2005 that adds other controls dynamically. This is a fairly simple test project, with checkboxes added to the control at run-time. Here's the user control:
Public
Class UserControl1
Public x
[Code]......
Then I built the test control and tried to added it to the Toolbox. When I did this--i.e., browsed to the dll and double-clicked it, I got the errror message:
"There are no components in ... that can be placed in the toolbox."
Is it even possible to add a User Control to the Toolbox without compile-time components?
View 5 Replies
Aug 25, 2009
I use VS team system 2008. At the moment i need to test some business classes, i have found two kinds testing NUnit and the unit testing provided by the VS team system. what are there differences?
View 1 Replies
Nov 28, 2011
I know about user controls and custom controls, but I want to build a control like the Open File Dialog or Event Log Components that don't have UI and just pop to the bottom of the form like the OFD. How do I do this?
View 2 Replies
May 13, 2010
I'm building an Active Directory wrapper in VBNET 2.0 (can't use later .NET) in which I have the following:
IUtilisateur
IGroupe
IUniteOrganisation
These interfaces are implemented in internal classes (Friend in VBNET), so that I want to implement a façade in order to instiate each of the interfaces with their internal classes. This will allow the architecture a better flexibility, etc.Now, I want to test these classes (Utilisateur, Groupe, UniteOrganisation) in a different project within the same solution. However, these classes are internal. I would like to be able to instantiate them without going through my façade, but only for these tests, nothing more.
[Code]...
View 1 Replies
Jun 8, 2009
I need to generate a GUID so I can store into a table and the create related records (to be filled in later) in 3 other tables. Used to be easy in VB6 with the CoCreateGuid() function. But I'm not seeing anything in VB.Net help files to match. Trying to use this function I get all kinds of COM errors. So I guess I can import several COM/DCOM classes to make it work, but maybe the overhead isn't worth it.
View 3 Replies
Aug 23, 2011
I have 9 tables with state information in them. They all have the same field names. I have a Crystal Report that is based on one of them. I want the user to be able to select a state and change the Crystal Report to use that table instead of the one it was based on.I mean when user select text in combo box and then click on "OK" then report show (using only one rpt for all the tables of same fields).
View 2 Replies
Sep 13, 2011
'm reading in a .txt file and then writing it back out. I had a user request to substitute some values that need to change.EA to PRFT to EAI know how I would do that in SQL, but I do not know how to change the values of the information inside of a WriteFileStream
View 5 Replies
Apr 16, 2011
I've been learning how to implement genetic algorithms in vb, and some sample I downloaded basically does the following in a few places:
[Code]...
I gather that this process could be used to define the size of an array that is not known at creation, but becomes known later in the program. VB2010, however, doesn't like this code at all, and tells me ReDim can no longer be used to this end. Why? And is there an easy replacement for this?
View 1 Replies
Aug 6, 2009
what is the substitute for ADDNEW function in VB5 at the newest VS2008 their there was just recordset to which u apply this function then allwing u to add a record to a data base?
View 2 Replies
Sep 10, 2009
what is the substitute of PictureBox.hWnd of vb 6.0 in vb.net 2005 if any know then reply me soon.
View 1 Replies
Jan 12, 2009
I am working on the mobile device application and I have a simple form where I have a text box+submit buttom and datagrid
On value enter in textbox+submit, i want to display the the data related to that value (txtbox) in grid.
Now in the compact framework there is no option like Selected value There is selected all, selected text. With the use seleted text is not working.
Dim con3 As New SqlConnection("xxx")
con3.Open()
Dim cmd3 As New SqlCommand
[Code].....
View 2 Replies
Jun 22, 2012
I have a combo with 6 text NA,PO,FA,GO,VG,EX and I want to do a Linq query upon the selected value in this combo used as field in the where clause. for example:
'if "NA" is selected :
Dim query = from t in db.table where t.NA > 0 Select t
'If "PO" is selected :
Dim query = from t in db.table where t.PO > 0 select t
How to do this in elegant way without writing 6 if statement or using "Select case"
View 1 Replies
Mar 30, 2010
I have a dialog that gets called from time to time. It is only created once, and then shown or hidden. Depending on the current conditions, when I display it, I need to disable the controls on it so that the user does not make any changes.I have code that checks the condition and sets the enabled property to false for the controls. There is a DataGridView control on the dialog, and for some reason, it stays enabled and allows changes. Does anyone know why, or what I need to do to get it to not accept any input?
View 4 Replies
Feb 17, 2012
if there is a way to disable the WMP control from going fullscreen when the video is clicked on??
View 3 Replies
Mar 29, 2011
In .net 3.5 windows forms I have a listview with "CheckBoxes" = true. Is it possible to dim out or disable some items to prevent the user from checking the box?
View 3 Replies
Aug 6, 2010
I have been googling for hours and trying to figure this out, and I just can't.I have 1 webbrowser control on a form, webbrowser1. Once I load a page, say google.com, if I use webbrowser1.refresh() or webbrowser1.navigate("google.com"), it's not reloading the page, it has it cached so it's just reloading the cache. This is terribly apparent especially on pages like forums or craigslist.
View 6 Replies
Mar 6, 2009
I creating a dice game with VB 2008 and am having some problems with control features.When the game starts I'd like the controls to be disable until the user formally selects a NewGameButton.Also, during the game the user gets 3 chances to roll the dice before they select a check box for the type of score they want. They cans select a score at any time during the 3 rolls. I disable the selected score with an AcceptScoreButton, but I can't figure out how to limit there score selection to 1 checkbox per roll session. Then when all the score have been selected I need to diable all controls againg untile the user selects the NewGameButton I am using VB Express 2008Vista Home Premium32 BIThp pavillion a6666tintel core duo e8400 @3.00 Ghz3GB RAM
View 2 Replies
Jun 21, 2010
I had a form (says form A)with control on it, 2 buttons with text "View Process Flow"(Button1) and "Manual trigger Process"(Button2). Both button will load and shows Form A in Panel1 in Form1, but button1 will let user to see the action but block them on clicking on it, button2 will let User see and clickon the control.
In other software, I can use a transparency button or form block User by acess formA(so, they can see,but not click), But VB2008 transparentcy option kind of idiot(Or i dont know how to use it?)seem it just change the control back color to parent's backcolor(totaly useless, and the "tranparen key" as well)
I cant disable control cause it will stop the animation, only ways i can think off is add in a IF statement in every button, so it will do nothing when viewing = true.
View 4 Replies
Jan 3, 2010
I have my numeric up and down control set up but there is one problem. When i run the application, there is an IBeam in the value box. I have got my alphabet and arrow keys mapped to other things so when i press them windows makes the annoying beep noise. How can i get rid of the IBeam from this control permanently? I have tried the read only setting but the beam is still there.
View 1 Replies
May 1, 2009
in vb.net 2003 , how to disable images loading in webbrowser control
View 1 Replies
Aug 2, 2009
How can I disable the mouse while it is over my web browser control. I do some code-navigating so I do not want the user to interact with the control while it is doing its thing (and it has to be visible)
View 3 Replies
Jun 13, 2010
I want to speed up loading of pages, as i dont need my webbrowser control visible, nor in direct user i/o use, so i thought i'd disable image loading, and/or css only for that application. Obviously i came here coz i dont know how would i do it btw. does anyone know how to disable right click on webbrowser control?
View 8 Replies
Jun 9, 2009
how I can disable the various button on a BindingNavigator control? For instance, if a user is adding a member I want to disable the Delete button and all of the Move arrows, plus the ability to change the Position number.The same applies to clicking the Delete button. Diable the Add & Move buttons, etc.I tried BindingNavigatorMoveFirstItem.Enabled = False but that has no affect that I can see. I can still click the movefirst arrow and move away.
View 2 Replies