Handle The Back Key From ConnectionSettingstask Called Directly From A Secondary Tile
Mar 8, 2012
i have a small wp7 application with just a main page. The main page has 4 buttons and calls the ConnectionSettingstask for wifi, bluetooth, airplanemode and cellular data setting. I have also managed to create secondary tiles for any of these buttons. The OnNavigateTo event handles the secondary tiles using a key passed from the tile [code]The problem ia that when the user uses the secondary tile to call a task, the application opens directly the connection settings page, but after that the back key, instead of opening the phone main menu, open the main page of my application
View 1 Replies
ADVERTISEMENT
Jan 31, 2011
My tile-based map editor project. So far, it works really awesome. Here, look at a picture: [URL] And the screenshot is outdated: Now I got the Pencil, Rectangle and FloodFill tools too!, the tilesets are from that popular (well, not so popular) game engine called RPGMaker.
Currently, this is how the map is structured:
One ArrayList represents the X coordinates.
One ArrayList in each X represents the Y coordinates.
One ArrayList in each X,Y represents the tile.
The tile is an ArrayList containing three elements:
The Image name (Tileset01 in the screenshot), the X coordinate in the image, and the Y coordinate in the image. Those coordinates are from the TILESET01 image, not map.
Getting the idea?
How do you locate a tile in the map when it is clicked?
First I get the cursor's position on the map picturebox, then convert it to a multiple of 32 (the tiles are 32x32, yes), divide the position X and Y by 32. The results are the indexes I need to get to the tile I clicked.
That method works just fine for me.
When the map picturebox invalidates and needs painting... When that happens, I iterate through each X and Y arrayList. When I get the arrayList that represents the tile, I use it to draw on the map.
For example:
Iterating X arrayList.... step 8......
Iterating Y arrayList..... step 3.......
Found arrayList with three elemetns: ("Tileset01",32,96)
Draw image on the map picturebox, source is "Tileset01" on rectangle (32,96,32,32)... draw it on map picturebox's point (8 * 32) and (3 * 32)
And so on.
Now you understand how I am working with my map editor, how I am locating clicked tiles, and how I am drawing it. Everything goes fine, except for one problem: At some point, the user might want to make a 500x500 map.
That means, an arrayList with 500 elements representing the X tiles. Then an arrayList with 500 elements for each X tile, representing the Y tiles. Then an arrayList in each X,Y pair.
Then multiply that result by 5, because there will be 5 drawing layers. How am I supposed to handle such huge maps?! My app explodes when I set the map dimensions to 500x500! 500x500 is the max setting allowed in my app. I also know that 500x500 map editors are possible, because I have seen others before. With great performance.
View 1 Replies
Aug 22, 2010
im am making a vb 2010 tile egine and i was wondering how to get place a tile on mouse click and allign it to a 50x50 tile grid, and wonder how i can sav this to a .txt file from a array of thew tiles and question ask.
View 8 Replies
Jan 11, 2011
I've been having trouble converting the following fairly straight forward c# code into vb.net 4.0, which I understand has anonymous delegates. I just havn't been able to figure it out yet.
_combo.DataBound += (sender, args) =>
{
var item = _combo.FindItemByValue(values[0].ToString());
if (item != null)
[code]...
I have tried the following
_combo.DataBound += Function(sender, args)
Dim item = _combo.FindItemByValue(values(0).ToString())
If item IsNot Nothing Then
[code]...
But the compiler complains that DataBound can not be called directly, but has to be called with RaiseEvents
View 2 Replies
Feb 3, 2009
I have a Toolstripmenu with ten drop-down items in it.(named menu1, menu2, menu3 etc)
I have a sub with ten handles Menu1.click, Menu2.click etc.So clicking on any of the ten menu items calls the sub.But- how do I find out which one of the menu items was clicked?
I want basically:
foo = clickedmenuitem.text
I could do it with ten different subs but that would be a lot more code.Especially since the sub is quite large and I only need to know which item was clicked for a small part of it.
How do I find which of the ten handles for the sub was triggered?I tried handle.tostring but that gave the same string of numbers for each menuitem, that was clearly the wrong command.
View 2 Replies
Mar 5, 2009
i AM TRYING TO USE A THREAD TO UPDATE SOME CONTROL during runtime using invoke and i get this message.here is my scenario:im trying to build a performance monitor tooli have a mainform that is MDI parent and i create mdi child using
[Code]...
View 4 Replies
Dec 25, 2011
what is the error in the bleow: 'Public Event OnFilterAdded()' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event. Note: the error line is italic underline
Imports System
Imports System.Collections
Imports System.Configuration
[Code].....
View 3 Replies
Feb 1, 2010
This is what I have..Dim frmSettings As New frmOptionsfrmSettings.ShowDialog(Me)frmSettings is a settings form that you can choose the color for background of form1(Me)
View 1 Replies
Aug 27, 2010
I have a filesystewatcher object. On it`s event it runs a procedure which fills a treeview with a data. I had problems with treeview methods, but when I run them using invoke method everything is ok. But I still have one problem. When I load the form for the first time, everything works fine. But, when I then close the form (me.dispose, me.close), and load it once again, when Filesystemwathcer start the procedure i have an exception "invoke or begininvoke cannot be called on a control until the window handle has been created" trying to run a treeview.invoke method?
View 9 Replies
Feb 9, 2011
i was wondering if it possible to have a condition where lets say you have a column in the datatable called amount and a textbox acting as the filter called say maxamount to set it so the rowfilter when filtering the table will sum the number in the amount column until the number in maxamount is met, then stop and only return the rows where the total sum of the amount column is equal or less than the maxamount value, so i guess if the next row takes us over the maxamount it discards this row and returns the rows previous to it. is this possible using datagridview rowfilter or should i be loooking elsewhere to achieve this?
View 4 Replies
Jun 5, 2011
I have an sql table called Stock with two fields called StockID and StockCode. I want the user to select the stockcode from a combo which in turn populates the stockid for that item into a lable on my form. I have already populated the stockcode into the combo but dont know how to compelte the rest.
Imports System.Data.SqlClient
Public Class cbo2
Private Sub cbo2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
[CODE]...
View 4 Replies
Aug 11, 2009
I have a form called FrmPracDetails which is built up with a List view called LvwColProc. Therefore when you click a field on the LvwColProc it takes you to another form called FrmColProcessing, here you can make changes to certain fields which are also present on FrmPracDetails. What I want to do is when you make changes on FrmColProcesing and Click the Save Button (which calls the Save function)the changes appear instantly on FrmPracDetails. Please note, FrmColProcessing will always be open next to FrmPracDetails. I have tried to put this code in the Save function present in FrmCol Processing as shown below, but it doesnt Refresh FrmPracDetails form. [code]
View 1 Replies
Apr 2, 2012
I have the following line of code in my program:
JCL_History.Enqueue(JCL_History(I))
This JCL_History object is basically a Generic.List encapsulated in a wrapper and has the following method:
Public Sub Enqueue(ByRef value As String)
If Members.Contains(value) Then
Me.RemoveAt(Members.IndexOf(value))
[Code].....
In my testing I have 2 items in this JCL_History list. When I call that first line of code I posted (the one that invokes Enqueue) with I = 1 I expect the first item to be shuffled to the bottom and the second item to be shuffled to the top.
After the thread returns from Enqueue I notice that this is exactly what happens to my list, HOWEVER if I hit the "step_in" button after the execution of Enqueue I go into the Default Property's set method where Index = 1 and value = and it screws everything up, because the item that got shuffled to the end (index 1) gets overwritten by the item value shuffled to the top.
So basically the set method on the default property is getting called at what I think to be a completely ridiculous time. What gives? By the way I'm running VS2005 on XP.
View 1 Replies
Aug 26, 2010
I've got an app working semi-background stuff in the GUI thread. Another thread won't work and a timer won't work. But I want the app to be responsive while I'm going my 'background' work.I cound use application.doevents - but that gives me 3 bad choices:
-loop with no sleeps - end peg an entire CPU (my task waits on stuff besides calcs & I/O so this matters)
-loop with a sleep - then the app slows down
-Try to make a 'smart sleep' loop that speeds up when lots of messages happen (check for messages in messagefilter function)
[code]why I can't use application.run, or threads, what I want to do is handled the OnUnhandledException event, then leave my app open for a while while some winforms stuff closes it down gracefully and tells my watchdog program to restart the app. after allowing the user to finish a critical process, too. Yes, I know people thing that a program getting OnUnhandledException deserves to die (obviously MS), there are 'dangerous' things that could happen; none of them are as dangerous, however, as the wrath of my users. Looking for vb.net sourcecode exact translations of the above two functions.
View 5 Replies
Sep 8, 2010
I've developed an application in VS2008. Whenever I dragged the application from the primary monitor to the secondary monitor, the mouse cursor changes from the default one to resize when hover over windows title bar. How do I fixed it? I want it to remain as the default one.
View 3 Replies
Jul 8, 2010
I have a dual monitor setup. I want my app to run in the secondary monitor by default (through settings in my app). I have been browsing the net for a solution and I found a solution which is setting the Form.Bounds to the Bounds of the secondary monitor. My problem is that if I set the bounds of my newly created form, when it gets displayed, it doesn't show in the secondary monitor.
private void button2_Click(object sender, EventArgs e){
Form1 frm = new Form1();
frm.SetBounds(-1280, 112, frm.Bounds.Width, frm.Bounds.Height);
MessageBox.Show(string.Format("frm.Bounds [{0},{1}]",frm.Bounds.Left,frm.Bounds.Top));
//frm.Bounds = Screen.AllScreens[1].Bounds;
//frm.Location = Screen.AllScreens[1].Bounds.Location;
frm.Show();
MessageBox.Show(string.Format("frm.Bounds [{0},{1}]", frm.Bounds.Left, frm.Bounds.Top));}
In the code above, I first set the bounds, I can see from the message box the settings I assigned. After form gets displayed, I checked the bounds again, it has changed to it's default. How do I show then a newly created form to a specific Bounds?
View 2 Replies
Feb 18, 2011
I am currently working with a program where the user is prompted to click certain points on a picture within the picturebox on my form. The issue is that some of the points need to be pretty precise and i want to give them controls to slide the points once they have clicked them. The method for sliding is fairly simple but i want to be able to graphically show it in a secondary picturebox.
[Code]...
View 21 Replies
Apr 27, 2012
I am trying to write a VB .NET program that runs a Perl script and reads and uses the standard output. I'd like to be able to handle each line separately as it is printed, and update my program display accordingly. Here's some code I have "written" (read: "mostly copied off the internet"):
Private WithEvents pscript As Process
Private Sub myProgram_Load(sender As Object, e As System.EventArgs) Handles Me.Load
pscript = New Process()
[Code]....
This works with one problem: the program waits until the test script has run to completion, and then fires several OutputDataReceived events one after the other. This means that when I make it use the real script, it's likely to do nothing for as much as several hours, and then have to deal with, like, 5,000 events at once, despite the fact that stuff was being printed at fairly regular intervals throughout that time.
Is there any way I can make it deal with each line of text when it is written, instead of all of it at once at the end?
View 2 Replies
Mar 25, 2009
used the WMI ChangeZoneType DNS command in C#VB.net before. I get an incorrect parameter exception when i try and invoke the changezonetype command. I get the dns zone that i want to change from the dns server (via query), set the zonetype to the appropriate uint value but am then getting the exception. I am trying to change the zone from secondary to primary and according to MSDN all the other values are optional (and as far as i am aware are needed when you want to change from primary to secondary) so i have not included them.
Below is the code that i am using....
For Each DNSZone As ManagementObject In mgrZones
mngrZones = DNSZone.GetMethodParameters("ChangeZoneType")
mngrZones("ZoneType") = System.Convert.ToUInt32(zoneType)
[code]....
View 2 Replies
Jun 17, 2009
I have been working on a project of mine that will streamline some issues at the office. (Note: There is not much in way of documentation or comments as I just started on this)
This is what I have so far and I am getting this error:
"System.ObjectDisposedException was unhandled"
I can edit the database with the second form initally, but it pops up an error after I return to Form1 and then attempt to enter into the 2nd form any subsequent time after the first initial load.
Here is my code:
Option Strict On
Option Explicit On
Public Class Form1
[Code].....
View 2 Replies
Apr 12, 2007
What I'm trying to do is to launch Powerpoint Wiever 2003 in my secondary screen.I can get a form to launch in the 2nd screen but any programs I launch from that form stary screen.[code]
View 5 Replies
Jul 21, 2009
I have two forms for my application, that are visible in the Windows taskbar. When a modal dialog is popped up on the main form, the secondary form is locked. However, when the user clicks on the secondary form on the taskbar, it appears over the modal dialog box, and is basically frozen. Is there a way to ensure that the modal dialog box does not draw underneath the secondary form? The topmost property is no good, since this draws on top of everything, even stuff not related to the application.
View 1 Replies
Nov 30, 2011
I have below Visual Basic 2010 code to draw a chart using Excel then export to picture. I am not able to create the seondary value axis. i keep getting error "failed to call COM component". The problem is coming from the bolded section. However, why i remove it the chart comes with secondary axis but problem i need to set an axis title which i am not able to do so. what is the correct way to create a secondary axis and title in Excel.Interop?
[Code]...
View 1 Replies
Nov 25, 2009
When I isolate the following code to create a chart, the result is normal. But when I call it from a control, duplicate legend and Y-axis scales and labels appear.
I did a line-by-line comparison and detected no code differences.
1) What is the likely culprit?
2) Is there a cleaner way to activate a graph?
Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
Dim frm As New WindowsApplication1.Form8()
[Code].....
View 5 Replies
Apr 11, 2012
Can you look at my coding and let me know what I'm missing or doing wrong?I have a SSRS report that is called from a ReportViewer control and the ProcessingMode for this control is Remote. The report also has 1 parameter in it's DataSet.In the code I placed a MsgBox to make sure the code is finding the parameter and returning the parameter name. I am trying to stick the value of 10 into the parameter for playerID 10. Data for this player does exist.
I believe I need to add some more code to make this work but I'm not sure what else to add.
When the code executes the report is displayed but no data is shown in the report.
[Code]...
View 1 Replies
May 13, 2010
I recently found an awesome tool called "Freemind" that is called a 'mind mapping' program. It's similar to MS Visio but way cooler and more automated.I reeeallly would like to integrate this into a VB.net Form, but how?
Has anyone seen or heard of mind mapping inside VB.net before? Are there programs out there already that work with VB.net or anyone have an example they have seen / built that works?
View 5 Replies
Mar 28, 2010
(non-coding request)Okay, I have my client, my server, and my map editor...a 2d online game, and yes it's written in VB.NET.I have had a lot of trouble finding anything to do with adding an animation layer something that will flash with a timer to appear as if something like fire is animated. I have a lot done so far and I kinda want to stick with VB.NET working with this.
I'm not really looking for code here, but maybe an idea of "how" an animation layer plays into a map editor and client...specifically what is needed.Running this through my head I believe I am going to need a timer on both the map editor and client, showing and hiding the animation layer...but I don't think it is that easy, and am hoping someone here has an idea of the logic of how this works. I'm almost certain that the timer doesn't go on the server to control this, but am probably wrong.
View 2 Replies
Feb 28, 2011
I Making A Tile Map but i ran into a problem.How can i determine what tile the mouse is on?Here is some code of my project:
Private Sub GameMap_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles GameMap.MouseMove
mousex = e.X
mousey = e.Y
[code]....
View 3 Replies
Apr 21, 2009
Essentially I have a half text/half graphical tile game that has a level designer. I have several sets of tiles, all of which are bunched together in one file. I'd like to read a certain 32x32 square of said bitmap, and display only that portion on specified area of the screen. I know GDI+ enough to get the display going, so I just need help with reading the specified portion of the image from the bitmap.
View 4 Replies
Mar 17, 2012
I've managed to implement a formula that helps me to get the closest tile's distance that meets my requirements. The only thing is, I can't retrieve the actual tile for some reason... Tiles are named "Items" also. Here is my code:
[code]...
It puts green squiggly lines under ClosestItem and gives me the error: "Warning 2 Variable 'ClosestItem' is used before it has been assigned a value. A null reference exception could result at runtime."
View 7 Replies