sandyk - MSFT's Q&A profile
Visual Studio Tools for Office inserting page breaks
Hi all how can i insert page breaks programmatically. i have no clue for doing this. any help in this regard is highly appreciated. something like this document.Characters.Last.InsertBreak( ) or i am not sure. Thanks in advance ok got it Object Type = new object (); Type = Microsoft.Office.Interop.Word. WdBreakType .wdPageBreak; document.Characters.Last.InsertBreak( ref Type); has done the trick for me Thanks for ur support. ...Show All
Visual Studio Tools for Office [VSTO V3 / Office 2007] Adding an image to a Picture Content Control ?
Is it possible Here is what I've tried (ImageUrl is a HTTP Url to an image): object ImageControl = 4; Word. ContentControl ImageCommercialControl = this .ContentControls.get_Item( ref ImageControl); object missing = System. Type .Missing; try { ImageCommercialControl.Range.InlineShapes.AddPicture(ImageUrl, ref missing, ref missing, ref missing); } catch ( Exception ex) { } Here is what I get: This method or property is not available because the current selection is locked for editing. But, after looking at its properties, i know that my control is not locked... Somebody know what's the problem Thanks My goal is simple: I want to display a list of c ...Show All
Windows Forms Parent the Form
How to add form to ToolStripSplitButton I try this: With Frm .Parent = ToolStripSplitButton1 End With No can do, DropDownItems doesn't act like a ControlCollection and doesn't implement the IContainer interface. There are commercial toolbar controls available that allow you to do something like this, can't find an example just now... ...Show All
Visual Basic MSN Messsenger Personal Message Customization
How can I programatically change my MSN Personal Message using VB.NET I don't know, but have a look at http://www.msgpluslive.net/. That software programs against Live Messenger so it must be possible. There might be something in their forums which will help you. ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Spacewar failed to launch...
Error 1 Error code: -1 encounted when initializing FBX file loader. The file is either corrupted or it is not a valid FBX file. C:\...\Visual Studio 2005\Projects\MySpacewarWin1\MySpacewarWin1\Content\Models\p1_pencil.fbx MySpacewarWin1 corrupted :( I got the same error when starting my project for the contest. I haven't really looked into fixing it but what I did instead is create the 360 spacewar kit and then create another XNA windows empty project and add all of the 360's spacewars files. Now I have two projects using the same files and I can easily switch between PC and 360. ...Show All
Software Development for Windows Vista WebserviceInput and Enum in interface definition will not bind to properties
I run into the followinf problem using a webserviceInput that implements an interface for me. The interface has the following prototype: public interface ITripApproval { ApprovalStatus ApproveTrip( string from, string to, int cost, TimeSpan duration, TripReason reason); void VoteTrip( string tripid, ApprovalStatus status); ApprovalStatus GetTripApprovalStatus( string tripid); } Now when I want to bind the ApproveTrip method to a webserviceInput activity I will see that it will let me bind the properties for the parameters from, to, cost and duration but the TripReason property will give me an dropdown box where I need to select the value from the enumeration. Now I don't want that parameter to get a fix ...Show All
Windows Forms String to int, Visual C# 2005
Hey, How do you make the value of this: pictureBox1.Width = (maskedTextBox1.Text); pictureBox1.Height = (maskedTextBox2.Text); an integer becuase I get an error saying can not convert string to int... Thanks :) ok, thanks :) It works, so aparently if there are no numbers in the textbox then it will give that message, but it looks good now that it does the error message box thing :) Thanks :) ...Show All
Visual Studio Express Editions Splash screen and startup?
I have a splash screen which I would like to have shown as the first thing when a user runs my program. After 20 seconds it should close and reveal the main form. ATM I have the following: I have the splash screen set as the startup form. A timer event on the splash screen form with the following: Me.Close() main.Show() When I run this the splash screen loads sticks around till the end of the timer, then the main form briefly flickers into view before it disappears again and the program seems to end. Does anyone why this isn't working All i got in there is mostly for loops. Private Sub main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim x As Integer = 0 Dim y ...Show All
Windows Forms listing files whose folder is in selected directory.
private void button1_Click( object sender, EventArgs e) { string s, p; s = textBox1.Text; listBox1.Items.Clear(); listBox1.DisplayMember = "FileAttribute" ; foreach ( string p in System.IO. Directory .GetFiles(s)) listBox1.Items.Add(p); } I can have a list of the file names in adress of string s.(folder of string s) But I want to have a list of files whose folders are in string s's folder. simply do: .. . string [] filesInCurrentDir = System.IO.Directory.GetFiles(currentDir); foreach ( string currentFile in filesInCurrentDir) { this .theListBox.Items.Add(currentFile); } or foreach ( string currentDir in System.IO.Directory.GetDirectories(path)) { forea ...Show All
.NET Development Updating IBindingList from different thread
I have a DataGridView which draws it's information from a BindingSource. This BindingSource gets it's data from a BindingList. Now, I need to update this BindingList from a different thread than the one that the DataGridView is implemented on. When I try to do this, I catch a thrown exception and the exception says that I cannot modify the control from a different thread (understandable). However, how can I work around this In my opinion, shouldn't the BindingSource or DataGridView controls ensure that the control is updated from the implementing thread Is this a bug Any suggestions would be welcomed - Thanks! ~ matt ISynchronizeInvoke is one way to implement a SynchronizationContext. Windo ...Show All
Game Technologies: DirectX, XNA, XACT, etc. graphics error
not sure i know what the problem is but when i run space wars it finds a line of code that says this .GameComponents.Add( this .graphics); and says it no suitable graphics device exception was unhandled Here is a thread where people had your same issue and the fix that worked for them. http://forums.microsoft.com/msdn/showpost.aspx postid=682322&siteid=1 The way it sounds from the thread, if the fix indicated does not work, then you will most likely need to buy a new graphics card that supports shader model 2. Definitely try the fix first though. Good luck! ...Show All
Visual C++ Should this sample run without a crash?
Hi, today I was testing some things and came across with something like this: #include <iostream> using namespace std; class A { public: void print() { cout << "test"; } }; int main() { A* a = 0; a->print(); return 0; } And I was a bit surprised when it ran without any problems both in debug and release in VS 2005. Well, I realize that since the code doesn't depend on the class, it may seem armless to run it but.. is this right Should it run in cases like this Is this standard or is it something that the VS team choosed to do since the code doesn't depend on the class I didn't check the standard yet to check if it says something about these cases, and I have to admit that sometimes it's hard for ...Show All
Smart Device Development Linking error with WM 5.0 using VS2005 RTM tools
Hi All, I'm compiling application for Windows Mobile 5.0 PocketPC. I have compiled sources with /QRarch4T /QRinterwork-return compiler options enabled and without these options. Also I have tried passing MACHINE:THUMB linker option but no success. Following are the error details : Error #1: Invoking CVTRES.EXE: /machine:thumb /verbose /out:"C:\DOCUME~1\seshah\LOCALS~1\Temp\lnk3CF.tmp" /readonly /windowsce "../../../install.wince/pda/tuner\tuner.res" Microsoft (R) Windows Resource To Object Converter Version 5.00.1720.1 Copyright (C) Microsoft Corp. 1992-1997. All rights reserved. usage: CVTRES [options] ResFile options: ...Show All
Visual Studio Team System Solution Explorer / Schema View / Design Time Database - Where is the 'Truth'?
We are running into repeated cases where the code contained in the Solution Explorer of DBPro is not the same as that contained in Schema View and not the same as that contained in the Design time database. This makes me wonder, where is the 'Truth' contained Microsoft has boasted that the 'Truth' is in the Project. However, what part of the Project Earlier today I used the Schema Compare feature to compare our project against a development database. About an hour ago I had developers tell me objects were not updated to the development database, they were missed. I then opened the Schema View and saw a warning that a resynch was required. I did so, then did another compare against the development database. A few more objects showed u ...Show All
Visual C# What’s the .NET collection class that allows an element to be accessed using a unique key?
What’s the .NET collection class that allows an element to be accessed using a unique key HashTable. I believe Dictionary is another class in framework 2.0 that gives the same functionality. ...Show All
