Picturebox Clicking Certain Locations?

Jan 13, 2011

I am working on making a picturebox that when clicked in a general location it will do something. Is there a way to make a grid out of a picture so when a certain slot on that grid is clicked an event will happen? It cant be an exact location, because that will be too hard to click. but a relative location would be perfect.

View 3 Replies


ADVERTISEMENT

Moving A PictureBox To Predefined Locations?

Jan 22, 2011

I'm working on a little board game we play here in Jamaica just to see how it would look and as a sort of challenge for myself while on vacation. I'm however stuck on how to make my markers (PictureBoxes - two per player) move along the board.So heres my problem; I have 40 slots where the picturebox can be moved to (eg picturebox1.Top = 324, picturebox1.left=243). Now moving to these slots are determined by the roll of a pair of dice. How can I assign a variable preferably an integer for each slot so when the dice is rolled I can just do a little addition as to where the markers can be moved?

View 7 Replies

Create Label On Clicking At A Picturebox?

Dec 17, 2010

Like the title sais, how to create a Label on clicking at a picturebox on the position of your mouse? The text doesn't matter.

View 13 Replies

Close One Form And Open Another By Clicking On A Picturebox?

Jun 4, 2010

I'm trying to close one form and open another by clicking on a picturebox.

I'm using this code:

Me.Close()
Form1.Show

But it shows an error under me.close. I know this is obvious, but I'm sleepy and have been trying to figure it out for a while

View 21 Replies

Unable To Draw In A Picturebox After Clicking A Command Box?

Dec 14, 2010

A rectangle is painted in Sub pBox1_paint. My intent is to add data to pBox1 via 'drawstring' in Sub btnMoreThan30. The first line of Sub btnMoreThan30 originally included 'ByVal e As System.EventArgs'. The compiler flagged the phrase 'e.graphics' with the error:'Graphics' is not a member of 'System.EventArgs'. I then modified line 1 of this sub as it appears in the code below. The compiler finds no errors but when I click on button 'btnMoreThan30' I get the runtime error,'InvalidCastException was unhandled. 'Unable to cast object of type 'System.Windows.Forms.MouseEventArgs' to type 'System.Windows.Forms.PaintEventArgs'. How can I draw lines and strings in a picturebox from a button_click sub? Code follows:

Public Class frmScoreboard
Private pbox1 As New PictureBox()
Private Sub frmScoreboard_Load(ByVal sender As System.Object, _

[Code]....

View 6 Replies

Clicking The [X] Closes But Clicking Exit Button Does Not?

Jul 11, 2011

When the user clicks the Exit button it closes the forms and if there was an open file it asks the user is they would like to save. But after the application closes there is still memory being held in Processes by the application. However, when pressing the [X] in the top of the form the application closes again but in this instance it is not held in Processes. How do I write the close for Exit to take into account how the [X] works and close the application cleanly?

Friend Sub CloseAllForms()
CloseHelpForm(True)
CloseDiagForm()[code].....

View 6 Replies

Single Clicking, Double Clicking And Contextmenu?

Mar 27, 2010

Someone asked me to add a function when the notifyicon is doublcliked. I figured that'd be easy with the mousedoubleclick event being available. I find out that then both the single and double will then be called. Well that sucks, I want it to only do the one the user requests. So I tried to get it to work:

Private Sub DblClick_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles DblClick.Tick

[Code]...

View 3 Replies

Get All Picture Box Locations?

May 12, 2012

I want to get all picture box locations. I am remotly creating them so i couldent just get each one individualy.

View 2 Replies

.net - Compiled Class In Two Locations

Aug 22, 2011

I'm a tad stuck trying to get a List to load from the ViewState using ASP.NET 4 and VB.NET. When I try to retrieve a collection using:

[Code]...

View 1 Replies

Drawing A GDI+ Path In Several Locations?

May 4, 2011

After a path is defined with all its components, is there a version of the DrawPath that allows the composite object to be drawn in locations other than the initial locationsFor example, the code shown below displays an ellipse and two rectangles in a specificocation. To also display the same objects in one or more other location,s, is it possible to disply the defined path at other locations or is it necessary

View 2 Replies

VS 2008 - Deployment Locations ?

Feb 14, 2010

The file locations for a setup package using Standard Edition? I have added an .xls file to my project, marked it as Content and as Copy Always in the properties for that file. The XLS file I added to the project is from my user Apps folder in the Roaming sub folder. Other simple .TXT files are in my UserMy DocumentsData folder and each file is also maked as Content and Copy Always. When I create the setup package all goes well. I have a setup.exe and an .msi file. When I test it by installing it on my PC of course the program knows where the files are because it's my PC. In the program folder created as C:Program FilesMyProgram I find the .exe plus the XLS and TXT files, but these XLS and TXT files are not used from the program folder. How might I know if an installation made by another user on another PC elsewhere is going to load files in their user apps or user documents? I need to be sure that the additional data files deploy to the correct location (whatever I want that to be) on a remote PC.

View 3 Replies

VS 2008 Object Locations?

Apr 23, 2012

I would like to make a simple functions for my program but I can't figure out what to do. I want the picturebox PBplayerbullet to be moved in the midle top of the picture box PBplayerim I know that if I use PBplayerbullet.location = PBplayerim.location will it to the top left part of the picture, but how it can be moved to the midle ?

View 5 Replies

Acceptable Application Folder Locations?

Jan 29, 2009

My application may be run by a number of different users and needs to be able to read and write to the same filles irrespective of what user is logged on to the PC.What is an acceptable location to store these files?i.e. a folder that has read/write permissions set as default.

View 2 Replies

Allow The User To Add Locations For Direct3D Icons?

Jan 23, 2010

I'm making a scripter to allow the user to add locations for Direct3D Icons, but I'm trying to make a sub for it...

Public Sub icoadd(ByVal mod1 As String, ByVal mod2 As String)
loc.X = defined.Location.X
loc.Y = defined.Location.Y

[Code].....

View 4 Replies

Application Settings File Locations

Dec 16, 2009

I want define where my application and user settings files will be located.I would also like to rename them.For example my project will have a number of folders located inside the application folder when deployed.One of those folders is labelled "Cfg" and i want my application settings files to be saved in there.This is including the user settings, i dont want to localize the user settings file as is done automatically (at least not at this stage).

View 3 Replies

Collection Of Locations - How To Skip First Record

Apr 7, 2009

I have a collection of locations for a sales person, allowing them to send an item to multiple locations. I want to start reading at index 1 since I am using a collection. I saw an example where you can say something like "+ 1" (e.g. myitem.SelectedIndex + 1) to skip the first record. How can I skip the first record for the following:

Public ReadOnly Property Customer() As ICustomer
Get
Return CType(Me.CustomerList.Item(Me.CustomerNumSelected), ICustomer)
End Get
End Property

I tried to say Return CType(Me.CustomerList.Item(Me.CustomerNumSelected + 1), ICustomer) but it returns an error saying "string cannot be converted to a double". without the + 1 in there, I get an error that says "collection index must be in range 1 to size of collection".

View 5 Replies

Comparing Characters At Different Locations In A File?

May 2, 2009

My card program generates a text file AllCards.txt - I want to know when the first character in this file is identical to the 3rd, 5th, 7th, or 9th. In this case I would need A (1st char) checked against the 5 (3rd char), 5 (5th char), 7 (7th char) and 8 (9th char).

[Code]......

View 12 Replies

Get X And Y Locations Of A Moving Butto In Vb 2005?

Mar 15, 2009

I used the code below to make the button move but now i need to get the current location of the X and Y and show it in a label on the form..ex

[Code]...

View 2 Replies

Move The Mouse To Different Locations In Another Application?

Feb 11, 2012

How can I move the mouse to different locations in another application. Currently, I used HDC and HWND to get my window's handle. (Also FindWindow). So, is it possible to like MouseMove(HDC, 5,5)?

View 4 Replies

Put Files In Certain Locations And Create Own Installer

Feb 11, 2009

I am trying to create an install for my application that I have just created using visual basic express. I want to be able to tell it to put files in certain locations and create my own installer. For example I want to make a license page with a read me on the installer. From what I understand the clickonce technology is what comes with express editions and you cannot do it with them. Is there an alternative to being able to accomplish what I want to do without having to purchase the full version of visual studio?

View 7 Replies

Saving Streamwriter In Two Seperate Locations

Jun 11, 2011

Greetings,

My app saves a bunch of stuff to an XML file. This is my line of code-
Using writer As XmlWriter = XmlWriter.Create("C:vdx2kMWSREEXTReportsInboxTK" & frmCitation.txtCiteNumber.Text & "Traff.xml", settings)

So that saves it at that specific location.

I need to duplicate the XML and have it also save in another location. I've been at this for days, Googling, searching, trying different things and now I need to turn here for help.

Any ideas?

View 2 Replies

Show Some Forms But Want Them To Appear On Specific Locations?

Sep 27, 2010

I want to show some forms but I want them to appear on specific locations . The problem is I don't know how to specify the coordinates . Using :

frm.Location = "0,0"
or
frm.Location = (0,0)

tell what is the correct syntax ?

And more thing : when a form is maximized or minimized , it looks like "flying" upwards or downwards . Is it possible to stop that visual efect ?

View 4 Replies

User Interface For Various File Locations

Sep 11, 2009

I have a generic question regarding file paths and user interfaces. I am trying to build a user-interface to accommodate various file locations. I typically build interfaces which deal with files on drives. As such, I use a directory tree for this. I usually work with files on local drives. However if I wanted to ensure that all file locations were dealt with I would want to ensure that I was accommodating files in all drives (local, network, mappped etc.). I am assuming that the treeview would support all of these drive option.

However if the files are on a sharepoint site or in some other type of enterprise content system, then am I correct to assume that these file paths will be URLs? If so, then am I correct to assume that a directory tree is not the correct control to use for these locations? Should I be providing a textbox to the user and prompting them to enter this URL? Or is it better to have the URL loaded into a ListView or ListBox (i.e. "My Connections") and then provide these as options via a dropdown box. I am trying to picture a typical user interface. Is it a directory tree AND a text box/dropdown box.

View 1 Replies

Forms :: Display All The Toilet Locations Via PictureBoxes?

Sep 2, 2011

I am creating an Interactive map which displays the facilities when the user clicks on the Checkbox, such as toilets. It will display all the toilet locations via PictureBoxes. I want to do this without having to write all this code?

Private Sub chkCash_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkCash.CheckedChanged

[Code]...

View 9 Replies

Keeping Control Locations Relative On Maximize?

May 22, 2011

I'm trying to figure out how to keep control locations relative on maximize. For example, if i have a button on the very right hand of my window, when i maximize it, i want the button to remain on the very right hand. Or when i grow my window, i want my controls to change location so its always relative to the size of the window. how can i achieve this?

EDIT: To provide a better example, if i have a window with a button in the center, when i maximize that window the button should remain in the center rather than in the same location as before and therefore being out of place.

View 5 Replies

Logic - Whenever Object Move To Locations, It Will Turn One By One ?

Oct 11, 2011

I have a variable called Map(19,19) is List Of Point and a Object(x,y).i want whenever my Object move to locations like Map(0,Y) or Map(19,Y) or (Map(X,0) or Map(X,19) it will turn one by one part of my Object to the other side for example when my object at location Map(0,Y) firstly, Object'head immediatetly appear at Map(19,Y) and then one by one part of it moves like that.Here my code: you can start watch from rbGeneral.checked, i already get a current position of my snake by declare 2 variables X and Y, but at If Clause i dont know put anything there to solve my trouble.

Private Sub tmr_tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmr.Tick
'Move Snake
Select Case currentDirection[code].......

View 1 Replies

Loop/design - Looping Through A Database With Pdf Locations

Sep 14, 2011

I am looping through a database with pdf locations. The application is button click event driven. The problem I am having is that I display a pdf. If the user clicks on the button then the pdf information is inserted into a database and the loop should be taking me to the next pdf. However, this loop does not seem to give what I need. What ends up happening is the first pdf gets displayed twice. I think mainly because I display the first pdf onload, but when I click the button it agrees and grabs the first item from the database. And it ends up falling behind because its restarting the query and I cant quite figure out how to get the button to catch the first displayed pdf, or skip it entirely since I am using a welcome pdf. So on the welcome pdf that is supposed to be displayed initially the user clicks agree and it agrees to the welcome pdf instead of just skipping it. I am not quite sure how to just move past the pdf.

public sub onload()
display the welcome pdf
end sub

[CODE]...

Now if I run the code without the loop it works fine. I just end up having to run the app however many pdfs I have in my database.

query data
display data
insert data
Windows.Forms.Application.Exit()

To display pdfs I imported the com control for adobe so pdfs get displayed like this:

axacropdf1.src = my.mysettings.default.readpath & pdflocation

pdflocation is passed from a query fill.

I think I have an underlying design issue which probably precedes the loop.

View 4 Replies

Place Controls On An Form Using A Database For Locations?

Dec 24, 2011

I am wanting to populate a form with check boxes and labels on starting of the app. My idea is to store to locations on the form in a database. I am creating an app that would have check boxes and labels that the user could check off to store points for completed tasks. The tasks on the form could change so I want the form to change as the tasks are changes with out re-coding the app.I am using VB 2003. I have searched but couldn't find anything.

View 2 Replies

Program To Store X Number Of File Locations?

Apr 25, 2011

As things are now, I need my program to store x number of file locations. My first approach was to use an array, however as i do now know how many files there will be, i am forced to use redim preserve. That is not very effective and I have therefore started using a StringCollection.

or is there some smart way to store these paths, that I have overlooked?

View 5 Replies

Use VB To Check Folder Locations And Registry Entries?

Apr 6, 2011

I want to create a simple program that runs in the background that every few minutes checks to see if any additions to the "startup folders and or the registry entries that run programs. How do I make the value of these folders or registry entries variables?

View 1 Replies







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