cgruenzner's Q&A profile
Visual Studio 2008 (Pre-release) VisualTreeHelper
I'm trying to get a location for button control using VisualTreeHelper .GetContentBounds function; here is my code void OnClick1( object sender, RoutedEventArgs e) { Rect mybtn = VisualTreeHelper .GetContentBounds(btn1); MessageBox .Show( mybtn.Left.ToString() ); } I get MessageBox with "Infinity" Why Just as a minor point, you should expect that VisualTreeHelper.GetTransform may return a null transform (specifically, if the visual that is passed as an argument doesn't have a transform set on it). As such, if you call a Transform method on the return value without checking for null, ...Show All
Microsoft ISV Community Center Forums Opening a Word file from a macro in Excel
I have some code that will open a Word document from a macro in Excel, but for some reason it won't recognize the Word file if the folders in the filepath have any spaces in their names. Here is the code: Sub MergeToWord() ActiveWorkbook.Names.Add Name:="MyData", RefersTo:="=Sheet1!" _ & Range(Selection, Selection.End(xlDown)).Address Shell "C:\Program Files\Microsoft office\Office11\winword.exe F:\\Shared Files\wordfile.doc " End Sub The line in red is where the problem is. Since there is a space in "Shared Files" it doesn't recognize the word file. Does anyone know a w ...Show All
Visual FoxPro GRID REFRESH
Im having problems refreshing a grid.i have placed a table in data enviroment.then i drag and dropped all of his items creating a grid.then in a button i have a select...where..into this table.this way i put new values in the table,basically i overwrite the entire table.at that time grid becomes white,no values i tried grid.refresh nothing i tried to grid.recordsource="" select where into... grin.recordsource=mytable still nothing is there a way to make the grid to reload the table Hi before the update or set the source to 0 ex: thisform.grid1.RecordSourceType= 0 ... do anything wit ...Show All
Visual Basic edit and continue
I can't seem to enable edit and continue in my VB 2005 app. Everyone seems to be pointing to Tools--> Options--> Debugging, but I don't have a debugging menu in my Tools--> Options. Any help would be appreciated. Thanks, Danny OK, so I found the debugging menu, and edit and continue IS enabled. But when I try to use it I get: "cannot currently modify this text in the editor. It is read-only" Any thoughts. -Danny ...Show All
.NET Development Handle property in textbox
In .Net Framework, there is a handle property in textbox control. How do I implement this handle value in vb.net of .net compact Is there a trick Thanks ! that checkbox was gray out. However, I was able to uncheck it. But I could not see handle property, so I went to tools -> options -> text editor again, I saw the checkbox is checked and gray out again. ...Show All
Windows Forms use a variable to cycle through textboxes
I have about 15 textboxes, all of which I want to save in a string array. Right now I just code: array[0] = txtbx1.text array[1] = txtbx2.text.... and so on. Is there a way that I can use a for loop and use x instead of 1 and 2. so it would look like this: For( x=0;x<=15;x++) { array[x]=txtbx + x.text; } instead of writing it 15 times Thanks. Use the Controls property of the form to get a collection of all controls on a form. The following code iterates through all the controls on a form. If the control is a textbox, it adds the text property of the control to the ar ...Show All
Visual Basic Real Time Data Monitoring
Hi All: I am writing a project to analyze data from a device in real time. The idea is to pick up the signal from a sensor through serial port in 20Hz and to do some calculation on the data received, and plot out the result on the form. I use a background worker to read data from the serial port and do the calculation within a Do Loop. There is no problem on this. My problem is that when I try to use GDI+ to plot the results on the form, data are not refreshed instantly on the form. I use a Collection of Single to store the data for plotting. Questions are: 1. Can Vb2005 do the job Or VC2005 is better 2. Is there a control ...Show All
Windows Forms Timer Issue
Hey, Usually I am over moderating at ASP.Net, but today I have a question for you guys. I have a timer that just is not firing. Can anyone help Imports System Imports System.Collections Imports System.ComponentModel Imports System.Configuration Imports System.Windows.Forms Imports System.IO Imports System.Data Public Class Alert Inherits System.Windows.Forms.Form Private Timer1 As System.Timers.Timer ...Show All
Visual Basic .application File cannot be found
Hello, I have a very simple application that I am trying to publish to a Windows 2005 server. During my testing, I sucessfully published my application using ClickOnce to my local IIS. I noticed two things that VS2005 did during the publishing process: 1. It created a folder with my current version of the application & four files (publish.htm, setup.exe, MyApp.application , and MyApp_1_0_0_0.application). 2. It created a virtual folder in IIS with the project name (MyApp). My problem is when I publish it to the Windows 2005 server. There are no errors during the publish process, and it opens the "publi ...Show All
Visual C# Newbie: How do I generate a report without a database?
Hello, I'm following the tutorial in Visual Studio 2005 on how to generate reports with Crystal Reports, but the samples require the existence of a database. If I just determine the values of 10 variables in a Windows App, and want to create a report to display (and save as a Word file or print) those values in a nice format, how can I do that Is there a way to use Crystal Reports without needing a report file (.rpt) or database file (.mdb) to start with Thanks in advance, Don You can create a blank report, add ten parameters (one for each field), place the parameters where you want them on the ...Show All
Visual Studio How to find the location of a .targets file?
We have a .targets file that implements a few custom build steps we need for our projects. One of those tasks is to call a command line tool to do some work with the assembly that was just compiled. We store the .targets file and the commandline tool directly in our source control (since they are both small) so that it is very easy for developers to build. They just grab the latest source tree and they have everything they need to build. Here is today's problem: How can our .targets file find the location of the command line tool Developers may have checked out the source code anywhere. The commandline tools is in the same ...Show All
Visual Studio Team System Modifying the default.aspx template
Has anyone had any luck modifying the templates for the TFS site I edited the c:\program files\common files\microsoft shared\web server extensions\60\template\1033\TFS\default.aspx file, but it doesn't seem to be working. Anyone have any insight Thanks, Kevin There are a couple really good articles that show how to do this step by step for modifying the Site Definition files and the Templates. http://msdn.microsoft.com/library/default.asp url=/library/en-us/odc_sp2003_ta/html/Office_SharePointApplyingCorporateBrand.asp http://msdn.microsoft.com/library/default.asp url=/library/en- ...Show All
Visual Studio 2008 (Pre-release) Username credential without windows account
Hi, I'm looking at the SupportingToken sample. The sample uses client and server certificates and then add a username password "on top" of this. The username and password must be those of a user on the client machine. My "users" will not be the a windows user on their machines.I s it possible to use an arbitrary username/pass Thanks If you want a username/password pair that's not a Windows account then you will need to subclass the UserNamePasswordValidator and override the Validate method: public class MyPasswordValidator : UserNamePasswordValidator { private ...Show All
Visual Studio Team System How to backup the TFS site
Hi For TFS beta 3 Is all the content stored in SQL server or are there other location that I should include in the backup regime. Ideally the SQL backup should be enough. Thanks in advance Warwick The TFS components are all DB based so it is essentially an SQL backup. For more info, check out this post here . ...Show All
SQL Server Row numbers on export
HI I have written a script to export data from customer table to another crm package, on the export they require the first column to be numbered 1 - .... say 1000 or how ever many rows there will be. Is it possible Thanks Rich Are you talking about a batch count Or does every row have to have a number If it's batch count then use DTS add a global variable, assign the count, then use the file system object to insert the count into the file after the export Denis the SQL Menace http://sqlservercode.blogspot.com/ ...Show All
