Ted Strom's Q&A profile
Visual Basic Enabling user control mouse events
I have created a user control and placed it onto a form and it all generally works OK. I have put code into the form to react to Mouse up, down and move events for the user control but the form code is never entered when I click on the user control. I am guessing that I need to put code into the user control to generate these events. If so can anyone suggest what is required "Clicking anywhere on the UserControl" is a bit confusing to me: if you're clicking a button on the UserControl, then the mousedown of that button will be triggered (in the UserControl code), not the mousedown of the UserControl in the form's code. If you dragged the UserControl from the Toolbox onto the Form and you're clicking ...Show All
Visual Studio Leave certain code out for release build...
I believe I read somewhere there is a way to leave code out during the release build of a solution... For example, I want to insert a bit of code during development, but not in the release version... What I remember reading somewhere - there was a tag or such you can put around your conditional code(compile conditional) or such... Is there a means to do this... Hello Warren, The syntax will depend on what lanquage you are using. For VB you would use #if DEBUG....#END IF Sub Main() # If DEBUG Then Console.WriteLine( "DEBUG is defined" ) # End If End Sub For C# you can use the #DEFINE DEBUG and #if - #endif #define DEBUG using System; public static v ...Show All
Visual Studio 2008 (Pre-release) Construct contextmenu for each item during databinding
Hi there, I'm trying hard to find out the event that will be raised when data binding. Example, I'm binding to a DataTable in a Dataset, and displaying the result using ListView. All I wanted to do is to construct a custom ContextMenu for each item in the ListView during data binding. The context menu content will vary from item to item (atleast the enabled property will change). At the moment I got the ContextMenu element for the ListView in XAML using ListView.ContextMenu element. Its showing the ContextMenu on each line item as expected, but since its referencing to a single context menu, any property change in MenuItem is reflected on each row. Any thoughts Saravana http://www.digitaldeposit.net/blog ...Show All
Windows Forms [Q] question about windows command
Hello, All I am working as UNIX admin primarily. However, sometimes I am supporting windows admin. Now, I would like to make a batch file in windows, not UNIX. That batch file has to find some files and move them to another folder. In Unix, I easily can do it like this " # find ./ -mtime +3 -exec mv {} /temp \; " But ... I have no idea which command in windows functions same as 'find' command & 'mtime' option in UNIX. Does anybody let me know how I can do this, please ... Thanks in advance. ...Show All
SQL Server updating batch record after exporting data
I created a package in SSIS to export data from mutiple SQL server tables to a single flat file . Once the export is completed i need to update 2 tables ( a batch table and a history table) In the batch table I need to insert a record with batch # (system generated),batch date, status( success/failed), record count( no of records in the flat file), batch filename). In the history table, i need to insert a record for each of the rows in the flat file with the foll info. batch number,datetime,status(success/failed) My question is how do I get the batch status,record count, batchfilename for batch table update and how do i get to update the history table. BTW, i am executing this package as a SQL Server Agent job. I am new to Integra ...Show All
SQL Server Problem in Mail Sending through Windows Application
Hi, I have made one SP(A) for mail sending which called within another SP(B). If i am executing that SP(B) in query analyzer then SP(A) ia also executed , while i am executing SP(B) through some WIndows Application although SP(A) is geeting allthe parameter but not executing. SP(B) is being used for inserting some values in a table.And i want to mail few of those inserted value to be mailed by SP(A). I have tried it by making "insert trigger " . But same thing when i executing SP(B) in Query analyzer the mail is going means SP(A) is running. But when i am inserting values through windows applicaton.Values are inserting but mail is not going. Thanks in advance. Sanjay Tiwari ...Show All
Visual Studio Express Editions Get User Full Name
I am banging my head against the wall... I am a LONGTIME VBA Coder... and one package that I use to get the Users Full Name is: Private Type USER_INFO_2 usri2_name As Long usri2_password As Long ' Null, only settable usri2_password_age As Long usri2_priv As Long usri2_home_dir As Long usri2_comment As Long usri2_flags As Long usri2_script_path As Long usri2_auth_flags As Long usri2_full_name As Long usri2_usr_comment As Long usri2_parms As Long usri2_workstations As Long usri2_last_logon As Long usri2_last_logoff As Long usri2_acct_expires As Long usri2_max_storage As Long usri2_units_per_week As Long usri2_logon_hours As Long usri2_bad_pw_count As Long usri2_num_logons As Long usri2_logon_ ...Show All
Visual Studio Express Editions Find and replace for textboxes!
Hi, I'm fairly new to Visual Basic. I'm making a simple text editor, and I want to make atleast a Find box. Here a screenshot of the find form I've designed: any and all help is extremely appreciated! The two methods you will want to use are the instr method and the replace method. If you just want to replace all occurence of a given string then something like TextBox1.Text.Replace( "Me" , "You" ) Will work just fine, It is case sensitive.... ...Show All
Visual Studio Team System Dynamic settings & values - config file?
What is the best approach to storing dynamic settings like the webserver name and database connection strings. We are running webtests and would like to be able to change the above settings in a config file rather than having to delve into our source code to change them every time. We tried adding an app.config file to the project and using the ConfigurationManger class to retrieve the values, but this didn't work. Thanks in advance. Hello Andrew, Refer to this post http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=147093&SiteID=1 Thanks Anjana [MSFT] Microsoft Developer Support This posting is provided "AS IS" with no warranties, and confers no rights. ...Show All
.NET Development We're not supposed to use List<T> ? ( List )
I installed FxCop and had it analyze my application. In several spots, it says: "Do not expose List<T> in object models. Use Collection<T>, ReadOnlyCollection<T> or KeyedCollection<K,V> instead. List<T> is meant to be used from implementation, not in object model API. List<T> is optimized for performance at the cost of long term versioning. For example, if you return List<T> to the client code, you will not ever be able to receive notifications when client code modifies the collection." I'm a bit weak in my OO.. so I'm not sure what "expose" really means in this context. Is this saying to not use List<T> ...Show All
Windows Forms "toolbar" applications
I am interested in creating a "toolbar" interface for a windows application. By this I mean an interface that is loaded onto the taskbar from the toolbars context menu, as is windows media player in mini mode, the language bar, virtual desktop powertoy, etc. I'm not ever sure what the proper terminology for this is and have been unsuccessfully so far in my efforts to google it. Is there a forum here that deals with this sort of thing If not, can anybody recommend any resources that might help Hi, I think the only way this can be acheived without paying for a tool which does this for you is to do this: Make a new form and set the topmost property to true. Then position it over where you wan ...Show All
Visual Basic Add items to listbox
Hello, I'm trying to make a project where when the user clicks btnCalculate an input box shows asking to input SPEED in miles per hour, followed by another inputbox asking for the amount of TIME in hours. It should then use a loop to display in a listbox on the form the distance the vehicle traveled for each hour of that time period. This is what I have thus far but I am stuck once again! This is an example of the output in the listbox: Vehicle Speed : 60 MPH Time Traveled : 7 Hours Hour Distance traveled 1 60 2 120 3 &nbs ...Show All
Visual C++ wide characters
#include "stdafx.h" #include <iostream> #include <string> int main() { std::cout << "Please enter your first name: "; std::string name; std::cin >> name; std::cout << "Hello, " << name << "!" << std::endl; return 0; } wchar_t where do i put this in for wide characters like japanese thanx From yesterday onwards I'm trying to post my reply. the reply automcatically posted to the forum while I was typing. after that I could not edit it. always showing error.Even I could not delete my answer :( please see my complete reply. String class defined using template class basic_string with type char You can use wstring in ...Show All
.NET Development Comm ports
Hi, Do you know any method to change the baudrate of my pc which "it speaks" with a device without closing the commports During this communication ,the device changes the baudrate so i must do the same in my application, but if I close the comms ,change the baudrate and open the ports again I have some timeouts and mhy application crashes... Thanks a lot nidionys, as far as I know, changing the BaudRate property does not require you to close/open the serial port. Just make sure you are not sending/receiving anything when you do so. HTH --mc ...Show All
Windows Forms Toolbar and menu items
Hello everybody.. I have two problems that are making me crazy... i hope some of you can help me.. I'm developing a windows forms app, vs2003, c#, and i have a typical toolbar on the top of my forms which i use as a menu, it has some several toolbarbuttons (some of them pushbuttons, other dropdownbuttons) and i need to change the text color displayed by the buttons, using my own specified color (rgb combination) but i can't do it.. the forecolor property of the toolbar seems to have no effect and the toolbarbuttons don't have this property available, i've tried with the text as images, but it doesn't work because only accepts icon formats (16x16) anything else bigger is not displayed correctly.... On the other hand my second problem is ...Show All
