Winforms - Find And Reference A Certain Form?

Jan 27, 2012

I am currently making an application to aid me in testing another separate application (both are made in VB.NET). I want my tester app to be able to enter info in a form on my other application. Since I have familiarity with both applications, I know the name and everything about the form I want to do things with on my testee app. My problem, is that I need a way to use this information of the testee form to get a handle or something that I can actually reference that form with in code for my tester app.

How can I go about getting this form? my only experience with something similar was getting the handle of a main window of a process, but that was a bit easier by doing this:

Dim iTunesID as intptr
for each process as process in process.getprocesses
if proc.mainwindowtitle = "iTunes" then iTunesID = proc.MainwindowHandle
next

However even that I am not really happy with because it needs to iterate through every process. and even from this, I am not really sure how to reference my specific window, since it isn't the main window in this case. I have tried searching for how to do this, but my search is a bit too vague I think as I just don't know what methods are available to use to do this or assist in doing it.

my first thought was something similar to above but with something like "for each form as forms.form in 'forms.formsrunning'" kind of thing, but I don't even know a command to get forms running, and though I guess I could probably find one, I am hoping for a better solution than iterating through all processes/forms.

View 2 Replies


ADVERTISEMENT

Find / Replace Within A String For Winforms

Apr 26, 2012

I have an issue with finding specific text within a string and then replacing it with " ", which is just a blank entry.[code]So now my issue is to search the ABCTEST text and delete text such as "Tier Market" from it. Then pass it to a new string perhaps ABCTEST_NEW..I know i might have to use a for loop to search out the keywords, but all the examples i have had a look at, are very broad.

View 1 Replies

Find Out Which Control Has Focus In .Net Winforms?

Mar 18, 2009

How do I find out which control has focus in winforms?

View 4 Replies

C# :: Find A Unique Session ID At Design Time In .Net WinForms?

Jun 11, 2010

I've created a custom clipboard because it's not possible to make my whole class map serializable - which is a requirement for the windows clipboard.However, I need to distinguish between users who are using my clipboard through a unique id. Basically, I want to be able identify a person who is sat at one PC with one or more copies of visual studio (or similar) open.

View 1 Replies

Winforms - Iterate Over The Items And Find Out Which Checkboxes Are Checked?

Feb 26, 2009

I am using the winform datarepeater control from vb.net power pack. All of the items on the repeater are readonly except for a checkbox column.I want to iterate over the items and find out which checkboxes are checked. I can't find a collection of datarepeateritems on the control and help is scarce.

View 3 Replies

Cannot Find Reference When Add Dll VS2008

Jan 21, 2010

I've created a dll in VS2010 with.NET Framework version 4.0 Now I want to add this dll as a reference in a 3.5 project in VS2008. When I do this I get <The System cannot find the reference specified>... does someone has a solution for this issue. When I downgrade the dll to version 3.5 I can add it as a reference and all works ok, but downgrading to 3.5 isn't an option because other dll's are depending on the 4.0 framework.

[Code]...

View 3 Replies

System Cannot Find Reference Specified

Dec 7, 2011

In my project i had an added reference which has always worked,, today and out of the blue i start getting this error

View 1 Replies

System Cannot Find The Reference Specified?

Apr 22, 2010

I have a Windows Forms application built in VS2005 and migrated to VS2008. I copied this application from one development computer to another, and now it states <the system cannot find the reference specified> for every single reference. These references are basic things like System, System.Data, System.Windows.Forms, etc. I cannot even look at the forms since it cannot find the reference to the DLL.

The computer the application was copied to has VS2008 installed and I can find the references in the appropriate location of (C:WindowsMicrosoft.NETFrameworkv2.0.50727) and also in the GAC (C:Windowsassembly)

However, even if I try to remove the references and add them back in again it still says it cannot find the specified references.

View 2 Replies

VB 2008 : The System Cannot Find The Reference Specified

Sep 19, 2011

I've created a class library in Visual Studio 2008, and when I try to add the dll as a reference, I get the message in the title for the Path field in my project references. I've been going for a week trying to figure out this issue, and I haven't been able to come up with anything. The strange thing is I can add the same reference to a Visual Studio 2010 project, and it works perfectly fine.I used VS 2008 to build it because the dll isn't used in house and needs to be compatible with .Net 3.5.

View 1 Replies

C# - Add A Reference To Some Source Code To Include In A Source File In .net, Winforms?

Jan 26, 2010

I don't know what this is called so I've struggled to find an answer from google but I have a vague memory of it from t'old days.I've sub-classed (* see below) about 8 framework controls, overriden some properties and added some functionality into each one.The changes I have made are identical in every case. If I make a change, I have to go through each class and apply the same change there.I was hoping there may be a keyword such as <IncludeSourcefile "common.vb> that I can put into each class.

(* note) I use the term sub-classed but I don't know if that's the correct terminology. I've also seen it used for call-backs. Is sub-classed the correct term to use?

View 6 Replies

Can't Find Any Reference Material Online For These APIs

Mar 10, 2012

I'm having some problems with some API calls. I'm trying to return device driver information for a given device in device manager so I can access the available information and display it. I'm using a series of API calls which in turn populates a list with device driver objects associated with that device. The API calls fail. The problem is that I can't find any reference material online for these APIs so I can figure out what's wrong. [code]

View 1 Replies

DB/Reporting :: Can't Find Mysql On The Add Reference Section

Jun 29, 2012

I am creating a database project where I take my data from mysql database and then create graphs and charts.I currently have microsoft visual basic 2010 express edition. I am familiar with visual basic but have never used mysql before. I have quried a database into mysql and server connection to the database is working fine. Furthermore I downloaded mysql a week ago so I have the latest connector.I looked at many youtube tutorials and have tried to find mysql.data in the add reference section (in project) but it doesn't seem to be
there.

View 3 Replies

Winforms - Error - Object Reference Not Set To An Instance Of An Object

Jun 20, 2012

exeption: Object reference not set to an instance of an object.

code:

For Each p As Panel In Me.Controls.OfType(Of Panel)()
arr.Add(p.BackColor.ToString())
Me.Controls.Remove(p)
Next

the line:

arr.Add(p.BackColor.ToString())

how can i fix this thing?

View 1 Replies

Winforms - Disable The Parent Form When Call A Child Form?

May 14, 2010

How can I disable the parent form when I call a child form?This code doesn't disable the parent form like I thought it would:

frmChild.ShowDialog()

View 2 Replies

Winforms - Know The Event Order Of Form Which Is Executed While Opening Form

Jun 30, 2011

I would like to know the event order of form which is executed while opening form. I am showing my form using following code and the code in form_load event executes twice. Once when the form variables are initialised and second when form is displayed. I want it to execute once only. form showing code:

[Code]...

View 1 Replies

2010 - Cannot Find A Reference To System.Data.OracleClient

Apr 18, 2011

I installed .net 2010 ultimate but my proble is i cannot find a reference to System.Data.OracleClient.

View 1 Replies

Winforms - Add Text To Form Without Interaction?

Mar 14, 2010

I have a winform project which lists all the files in a specified folder. It allows the user to select a new destination for each file, and when the user has chosen the destinations for all files that he would like to be moved, it moves the files, one by one.My next step is, I need to display a confirm form when the files are being moved, and add each file's name and destination to the confirm form as it is being moved.How can I add more text to the confirm form's controls after I already loaded it (using confirm.showdialog() from my other form, without any user interaction? I imagine that I need to do it from the original form, because it needs to display each one when it starts to move that file?

View 3 Replies

Winforms - Change Form Shape In .net?

Mar 28, 2009

I used to change the Form shape in VB 6.0 using the following code:Private Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long

[Code]...

View 4 Replies

Winforms - Form Transitions Without Using Timers?

Jun 9, 2011

For couple of hobby projects of mine, I've been performing form transitions (fade-in/out, slide-left/right) using timer control, and I know its not the right way to do it. Using timer has its own disadvantages as it is a CPU hog if logic is complex and also, transitions are not smooth. So, I'm wondering how can I perform form transitions without using any timers and just by using native Windows API or any third-party library. I came across with FlowFX but found that it is limited only to .NET Compact framework.

View 1 Replies

WinForms - Show Form Without Focus?

May 16, 2012

I would like to show a Form without focus - PLUS - I would like to have 'Enable Application Framework' enabled on the My Project > Application form. Having 'Enable Application Framework' enabled allows trapping of unhandled exceptions project-wide.

I have added this to my code:

Protected Overrides ReadOnly Property ShowWithoutActivation() As Boolean
Get
Return True

[Code].....

View 8 Replies

Winforms Form Transparent Background?

Jun 23, 2012

when i add my form into the picturebox the background color is argb(152, 0, 136)
and i tryied to use TransparencyKey and Still the background color is 152, 0, 136
code:

Dim frm As New Form
frm.BackgroundImage = Image.FromFile(open.FileName)
frm.BackColor = Color.FromArgb(152, 0, 136)

[code].....

View 1 Replies

.net - WinForms UserControl Version Of Form.Closing

Apr 25, 2012

I've got an MDI form with child forms that I'd like to refactor to a single form with a tab control containing child controls, in order to move away from MDI clunkiness. When looking at converting the child forms into child controls (or usercontrols), I do see that I'd lose the FormClosing event, which some of the child forms use.

I can override Dispose to handle some of the functionality, but in some cases I'd like to cancel the closing event. Also, I'd like this event to be called before the control is closed even when the form it's on isn't closing, so wiring the control to the form's closing event isn't an option.

[Code]...

View 2 Replies

.Net WinForms Form OnPaint() Transparency Refresh?

Aug 13, 2010

I'm trying to write some toast-style popup notifications (similar to Growl) which should appear next to the system tray and stack as appropriate.I can handle the instantiation/location/etc... but I want to add a capability for non-rectangular toasts. I'd also like to have Alpha transparency so a semi-transparent background PNG on the toast form would blend with the desktop or windows behind it.

So... To get the obvious out of the way: Form.TransparencyKey is not sufficient for my needs as it's an all-or nothing transparency effect I want to get 50/50 foreground/background in some places, 0/100 in others, 100/0 in yet others etc.My initial approach is to override the OnBackgroundPaint() method, comment out the call to MyBase.OnBackgroundPaint and use the graphics object in the eventargs to draw exactly what I want to a form.This seems to work to start with - at the moment, I'm just drawing some rectangle for testing purposes so a PNG may present new difficulties but I haven't got there yet.

What I haven't been able to accomplish is updating the graphic - The first time the form is rendered, it shows perfectly as I'd expect (no border, just some rectangles floating on a desktop). If I move the windows behind the transparent window, the transparent window doesn't update/re-paintI believe that I need to be calling Me.Invalidate() to force a re-draw but am unsure when I should make the call - How do I know a window behind me has changed its' contents?

Edit: I tried putting a Me.Invalidate() inside a timer just to test how the redraw happens - it seems that it does trigger a re-draw but the re-draw opccurs OVER the existing form background - ie an area that was originally 50% opaque is now 75% opaque (50% + 50% of what was there before)So, after a couple of Invalidate()s, my form is showing as a black box - I need to clear the background of the form before re-drawing but Graphics.Clear(Color) seems to simply do a fill with the specified color - and obviously for the purposes of this question, Colors.Transparent doesn't really mean transparent - It seems to be a trick used when rendering the window to "show contents of control beneath this" which just doesn't work when we're dealing with the form itself?

Imports System.Drawing
Public Class TransparentForm
Private Timer As Timers.Timer

[code]....

View 1 Replies

Can't Start WinForms Project Because Form Is A Type

Sep 27, 2011

I have a very small VS2008 Winforms project that will not start.When I attempt to start debugging the project, I get the message:'<form>' is a type in '<project>' and cannot be used in an expression.From the file .Designer.vb.The problem is that is indeed a form. If I create a new WinForm and set the startup object to the new form, I get the same message.When I attempt to check the "Enable application framework" checkbox in the Project properties, I get the message "Startup object must be a form when 'Enable application framework' is checked.I've tried creating a new project and moving all the code and designer objects to a new form file in the new project, and same result.Other projects on the same computer run fine.

View 1 Replies

Starting Properties Of Objects In Winforms Form?

Jun 11, 2012

In my software course, each time we submit an assignment, we have to include a document with the starting properties of each object in a form.

E.g.

TextBox1
Location: 241, 115
Name: TextBox1
Size: 100, 20
TabIndex: 0

It's a real pain to scroll through the properties viewer and copy and paste each customised value for 30+ objects on a form... I was wondering if there'd be an easy piece of code or way about getting an (at least partially) automated printout/view of all the properties of the objects.

Was thinking some sort of private sub I could past into the bottom of the program and run on load, that gets all objects, and outputs the non-default properties to a report or something?

View 1 Replies

Winforms - Handle A Form Close Event?

Apr 27, 2011

I have used the below code but its not showing the msgbox. What is wrong with this code ?

Private Sub frmSimple_Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Disposed
Dim result = MsgBox("Are you sure you want to Exit ?", vbYesNo)
If result = DialogResult.Yes Then
me.Close()
End If
End Sub

View 3 Replies

Winforms - Launch Form As A Separate Process

Mar 28, 2011

I have VB.NET application in which one of the form has IE control in it, the application starts initially with memory size consumed around 9 MBs, but when IE form is launched, the memory consumed rises to 27 MB, and when that form is closed, the memory reduces merely by 3-4 MBs, so why memory allocated to IEFrame is not de-allocated automatically?

View 3 Replies

Winforms - Play A Video File In A Form?

Apr 27, 2011

How to play a video file in vb.net ?

I need the video to automatically start playing on form load.

View 1 Replies

Winforms : Where Is Default Constructor Of A Windows Form

Jan 1, 2011

where can I find the default constructor of a windows form? I mean:

Public Sub New()

End Sub

I should say that I Use Visual Studio 2008 as my editor.

View 3 Replies

WinForms Form Hangs On Startup On One Machine

Jan 21, 2010

For my VB.NET application, I'm using the windows installer that came with Visual Studio. I can successfully install and run my program on any computer in our office except for one. On this particular machine, my program will stall for about 30 seconds before being able to load the main form. When I start up the task manager, the CPU is hovering at about 0 to 1%, so its not really doing anything but freezing up. It will eventually load, but it really shouldnt take this long, especially when it loads instantly on other computers. Now this machine is windows xp with serverice pack 3 and .net 3.5 sp1.

View 3 Replies







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