jackwc's Q&A profile
Visual Basic Process the contents of a listbox as an enum
Assume that I have populated the contents of a listbox with the members of an Enum. Further assume that a user selects an item in that listbox. Suppose that I want to determine which item was selected. Can I process the selected item somehow using that Enum and its properties/methods i.e., comparing the value of the listbox item to Enum.enumitem Yeah, you can use the shared function System.Enum.Parse: System.Enum.Parse(GetType(EnumTypeName), lboListbox.Text) which returns the value. EnumTypeName is the name of your enumarion. Be sure not to try to get a value for a non existing string value, you will get an exception. Regards ...Show All
Windows Live Developer Forums LatLong calculated with PixelToLatLong varies from e.view.LatLong
I am using the following to calculate and display the cursor location: latlong = map.PixelToLatLong( event .clientX, event .clientY); Then, in the map.OnClick event, I use e. view.LatLong to display the cursor location. However, the two values are different! Which one is right Since I'm adding data to a database based upon the location I feel it's important to get it right! Thanks John! Just to wrap this up, I now use the following to get my LatLong (based upon John's code above): latlong = map.PixelToLatLong( event .clientX - mapleft, event .clientY - maptop) ...Show All
Visual Studio Express Editions Keybord Hooks and System Hotkeys
I did find a great example: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=573928&SiteID=1 There are no bugs and works perfect for a set key combo. But my question is how can I make it accept a user's desired combo The code is straight forward for registering (of course we have to include the user32.dll but, well you have the link): Private Const MOD_CONTROL As Integer = &H2 Private Const MOD_SHIFT As Integer = &H4 RegisterHotKey(Me.Handle, 0, MOD_CONTROL + MOD_SHIFT, Keys.U) What I would like is for the user of the program to click on a textbox and enter their combo. So if I wanted Ctrl + Atl + P then I'd just hold down Ctrl, Alt and P then have this register as a System Hotkey. I enjoy writing these little ...Show All
SQL Server Errors using multiple parameters in a SQL Statement
In an OLE DB Source in an SSIS package, we are having difficulties using multiple parameters in a SQL statement. Using a single ' ' works fine, but I've read that when you want to map more than 1 parameter you should use 'Parameter0, Parameter1, etc'. The problem is that when we use Parameter0 and Parameter1 and then try to map it, it says that the query contains no parameters. Can anyone help with the correct way to use multiple parameters in a SQL query that's part of an OLE DB Source task Thanks, Mike Neither Parameter0 or just 0 is working This is the SQL in an OLE DB Source. At one point, 0 and 1 caused the parameter mapping dialog to appear, but these others are not workin ...Show All
Windows Live Developer Forums VE still not working...
My VE Application is not working ... Error: Map is null or is not a object The VEiSDK still not working too... :( []'s Its working for me Mauricio. When you get the dreaded map is null error it means that the VE javascript was not loaded before you tried to use it. I use this code to handle this a little more gracefully: var LoadErr = 0; function GetMap() { try { map = new VEMap('myMap'); map.LoadMap(); } catch (err) { if (LoadErr < 5) { LoadErr++; setTimeout("GetMap()",1000); }else { alert("The Mapping Control failed to load."); } } } The basics are to give 5 attempts one second apart to try to load the map. This is of coarse just the secon ...Show All
Smart Device Development Backup/Restore Tool for Windows M
Hi All, I have a query here – My objective is to develop a Backup/Restore Tool for Windows Mobile. Our prospective client suggested that we use the following APIs in our approach. BOOL WINAPI GetStoreInfo( HANDLE hStore, PSTOREINFO pStoreInfo ); BOOL WINAPI GetPartitionInfo( HANDLE hPartition, PPARTINFO pPartInfo ); My questions are these – How do the above APIs fit into a Backup/Restore System We looked at the documentation of these API calls on MSDN but could not find any example code/project samples to help us use the API calls in any such system. Can you provide us with leads to such resources Is it possible for you to advise us on developing a Backup/Restore s ...Show All
SQL Server Deadlock problem? 3 way conditional split of data from one table to another never completes
I have a source table which I'm splitting 3 ways based on a column value, but the target is the same OLE DB destination table. One conditional path is to a Multi-Cast two way split to same OLE DB gestination table. The default split is to a flat file for logging unknown record types. For a test I have data for only the 3 column values I want, but I'm having trouble with the process completing. If I pre-filter the data going into the source table by one or two values I can get the process to complete even if one split is to the multicast. If I include all three data types in the source table, I get different results depending on the order in which the conditions are specified - sometimes only two split paths are executed; other times all th ...Show All
Software Development for Windows Vista How to change the padding of Activity designer's container.
hi all. in the activity designer container , is there any property or overridable method let me to change the padding for child activity designer below is figure demo _____________________ | container | | _____________ | | | | | | | child | | |<- -> | | | |__________>this padding. i will change it.. anybody can give me some more idea thanks . ...Show All
Visual C++ sort a 'std::vector' containing classes/structures?
Hi, I want to sort a vector contain some data using std::sort. Here are the sample codes. #include <vector> #include <string> #include <iostream> #include <algorithm> using namespace std; class MyData { public : int m_iData; string m_strSomeOtherData; }; bool MyDataSortPredicate( const MyData& lhs, const MyData& rhs) { return lhs.m_iData < rhs.m_iData; } int main () { // Create list vector myvector; // Add data to the vector MyData data; data.m_iData = 3; myvector.push_back(data); data.m_iData = 1; myvector.push_back(data); // Sort the vector using predicate and std::sort std::sort(myvector.begin(), myvector.end(), MyDataSortPredicate); // Dump the vector to check the result for (vector: ...Show All
Windows Forms Monthcalendar odd event
I have a form with a listbox and a monthcalendar on it. I used to trap DateChanged on the monthcalendar to reload the listbox but had some odd behaviour. If I scroll through the listbox and leave it somewhere other than the beginning, after a time the list would jump back to the top. Did a walkthrough and noticed that the DateChanged event was firing even though no change had been made to the calendar, by me anyway. Question: Does the monthcalendar fire on time events as well as user changeing the selection for the DateChanged event, if so where is it documented. My solution was to change the event to trap DateSelected as it is annoying to be working through a list only to have it reload and reposition itsel ...Show All
Visual Studio Tools for Office List Object in excel - how to stop user deleting rows
how can i stop the user deleting rows from a data bound list object. There is no setter on the AllowDelete property of the BindingSource object, detecting when a row is deleted on the underlying dataset and rejecting the changes stops the row from being deleted from the dataset but it leaves an empty list row in the list. rebinding the BindingSource to the dataset has no effect either Hi Michael, I have tracked this behavior to a bug in the ListObject. If you select the row within the ListObject, this works fine, but if you select the entire sheet row, this is broken. I will track how and when you can get a fix for this bug and let you know. Thanks ...Show All
Visual Basic Procedures and Functions
What is the difference of function and procedures in vb what should i use Functions and Sub Function return a single value ie. Function Foo () as string End Function Sub dont return a value Sub Bar End Sub Saying that you can make a parameter on a sub return a value by passing it as a references using byref rather than byval which allows the sub / function to modify the contents of the variable in the calling function Which to use It depends upon you circumstances as to whether you want to return multiple values from a method. If you only want to return a single datatype (it could be a single datatype containing multiple values such as an arraylist) then a function may be suitable. If you wa ...Show All
Visual Studio Express Editions Structure problems
Hi. I've got the following code: Public Structure CATEGORY Public parent_id As Integer Public id As Integer Public linkid As Integer Public ico As String Public name As String End Structure Public Structure NAVTREE P ublic MyCategory As CATEGORY &nbs ...Show All
Visual Basic How to restrict user to tab (no mouse) selection
Hello, There are 9 numerical TextBox plus other TextBox fields on a DataEntry Tabpage. How to restict the user ability to MouseClick in one of these numerical fields The reason - to eliminate repeating if statements (which writes 0.0 s in the fields), in the case the user MouseClick into one of these numerical field but fails to enter any numbers. As it is now, data entry are into the numerical fields are limited to NumberKeys and initially the DateEntry Tabpage numerical TextBoxes are loaded with 0.0 by the Data>DataBinding>Advanced setting. Greetings, Most of your repetitions can be avoided by being clever with your event handlers. Keep in mind that a single subroutine can handle more than one event, and ...Show All
.NET Development Using webbrowser as a file explorer
I have a need for a component that can display files in a local directory just like Windows File Explorer but I want the window integrated into my application. I expected such a component to exist in the .NET base classes but after failing to find one, I then discovered some 3rd party tool on the internet to do this (but you have to pay for them), so presumably I am not being stupid in not finding one. However, after a little experimenting I have discovered that the WebBrowser component almost does what I want. If you call Navigate(filepath) it seems to display the same ActiveX component that File Explorer uses. The downside is that I get a task panel down the left side with 'File and Folder Tasks', 'Other places', 'Details' and the files ...Show All
