Clem Lau's Q&A profile
.NET Development Windows user control
Hi all , I need a help in using windows user control. I built a user control of simple keyboard . I seems like the windows calculator . My target is to pass the value I typed in the keyboard control into the textbox that called this control. In other words, when the click event is called in certain textbox, the user control will appeare, and after pushing close button on the control the value I types will passed to the textbox. How can I link between the calling textbox and the usercontrol result. Best regards... I'd put the keyboard on a small form that you popup with ShowDialog() when the user clicks the textbox. Give the form a constructor that takes a TextBox argument so you c ...Show All
.NET Development Name of cd-driver
Is possible to get the name of a cd-driver in .net I.e. SONY cd-rom CDU5211., not just D: Thank You. WMI can more than likely give you this information. Play with the WMI code creator to find the proper WMI query... ...Show All
Visual Studio Express Editions C# 2005 express edition + .net framework 2.0 sdk
Hi everyone. I want to start using the features that sdk has. But i have a problem. Don't know how to start T_T. I have installed C# 2005 express and .net framework. But i don't know how to use the sdk features. I tried also installing the directx 9 sdk and i can't use it's features neither. I just don't know how to do it. If anyone could help it would be nice :P Thanks Everyone and excuses for my english which SDK are you referring to if you are referring to the DirectX SDK have you looked at the samples and documentation Samples contain everything you need to know about how to use the directx SDK really. you need to add references to those assemblies you wish to use which give you access to use those class files. ...Show All
Visual Studio Tools for Office URGENT: Cannot Install VSTO June 2006 CTP!
When I click on the setup file 'vsto3ctp.exe', I am receiving the following error message: "You must first install Microsoft WinFX Runtime Components February CTP before installing or repairing this product." yet i am running the latest WinFX runtime components 3.0 beta 2, which it says should be fine in the documentation. Can anybody please help me to install this CTP as a matter of urgency. I have a deadline in a couple of weeks and really need to get cracking. Thanks! I am only a humble drone in the corporate beehive so I am duly obliging. :) Well OK, so here's the solution to your issue you initially posted: Add [HKEY_LOCAL_MACHINE\Software\Microsoft\WinFX RunTime\3. ...Show All
Visual Studio Express Editions hmm
Hello.. I am new to all this programming stuff .. Hmm... i am trying to make a simple macro to a game.. I want to repede some text hmm lets say that i press a botton then the program starts a timer.. this timer will take the text from a textbox and will add that text in my game.. i have done that by useing my.computer.keyboard.sendkeys(textbox1.text) and it is puts the text into the game and its nice.. Problem: how do i make my program press Enter in the game cuz i have tryed to use the my.computer.keyboard.sendkeys(ENTER) and it says that enter is an event and someting.. I don't understand that help please.. The short answer is, NO. Not with Visual ...Show All
Visual Studio Express Editions Trouble Downloading
I am having lots of trouble being able to download the application because it seems to be a dead link...is anyone else having this problem and is there a way to download the application which application are you referring to VS Express editions Tried downloading the entire ISO image for the language you are interested in Does that link work http://msdn.microsoft.com/vstudio/express/support/install/ what happens if you use a download manager Does it recognize the link and work have you tried clearing out your browser's temp internet files and cookies and history, and restarting the browser What happens have you tried using a different internet connection and downloading and burning to disc the ...Show All
SQL Server How to set page orientation to landscape?
How can I set the page orientation to landscape I tried to set "printDocument.DefaultPageSettings.Landscape = true;" but it didn't work. I have spent hours fixing the problem but I couldn't get it work. Below is the code: private void printDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.HasMorePages = false; printDocument.DefaultPageSettings.Landscape = true;   ...Show All
.NET Development Inheritance Issues with base class parameter
I have an abstract base class Person that my concrete Employee class inherits from. My web service take anything that can be cast to a "Person" as a parameter. When not using inheritance i modify my proxy autogenerated class and strongly type the parameter and it works fine. When i try the same, but this time using inheritance i get the following : "Use the XmlInclude or SoapInclude attribute to specify types that are not known statically." I have put two XmlInclude elements below the [WebMethod] of the service telling it about the concrete class and the base class. What am i missing I am using VS.Net 2005. thanks, Steven. Hi Nikhil - I managed to get it working. ...Show All
.NET Development Play a media file which is stored in isolated storage space..
How can I Play a media file which is stored in isolated storage space..... Regards RR raj.ramesh wrote: It just play a single sound... But I need to play the full media file... What do you mean by this As far as you have a media file in wav format i.e wth *wav extentions PlaySound() can handle it and the SoundPlayer class in .Net 2.0 is wrapper on the same API. So i cant see any problem even if you have a wav file of 5mb to play using PlaySound()! Best Regards, ...Show All
SQL Server SQL 2005 - BCP with bell (0x7 or /a) delimiter
Hello My company uses SQL 2000. We’re importing bell (0x7) delimited files using BCP utility on regular basis. Recently, I tested the same import with SQL 2005 BCP. It seems that bell is not supported anymore by 2005. Any delimiter but bell works. Is bell dropped from 2005 Can anybody point me to the proper documentation Thank you. ...Show All
Windows Forms Datagrid Freeze Panes (vb.net): Rows + Columns
Hi all, Does anyone know how to freeze the first row of a datagrid table. The columns of the table are not bound, nor is the property show header set to true because the header is imported in with the rest of the table data. Therefore i need to know how to lock / freeze the first row. Also, i was also lookin to freeze / lock the first two columns of a datagrid. Any ideas, help greatly appreciated. thanks, Paul nops it doesnt work . i only saw this working . the freezing part.. no idea. Me . BillDataGridView.Rows(0).ReadOnly = True Me . BillDataGridView.Columns(1).ReadOnly = True ...Show All
Visual Studio 2008 (Pre-release) WPF - Forcing software rendering for multi-threaded rendering (multi-core advantage)
Here is a good one for the experts (especially the WPF team): Consider a scenario such as this. 1. A control needs to be rendered and stored as a bitmap thousands of times. 2. Each rendering will be different, and all images will be saved. 3. Since each rendering is made to be independant, the control and all data can be created on its own thread, which allows multiple renderings to occur at the same time. Thus performance is improved significantly for multi-core systems. I already have such a system/design where this works using .NET 2.0 and winforms (GDI+). Since GDI+ uses the CPU, everything is great, I see a 70% performance increase for each additional core. However, since WPF will attempt to use hardware rendering, I assum ...Show All
.NET Development raising an event via reflection
Using reflection is it possible to check if an event has a handler and more importantly raise that event. I have a string with a value of the event and the object instance which I need to fire. Have you tried this in your called assembly when you are rasing event; if(SomeEvent != null) { SomeEvent(this, EventArgs.Empty); } And yes Sorry I listened for the first time that there is an EventInfo class, I'll have a look on this. Man is always learning :$. Try this and tell me what happens. Best Regards, ...Show All
Visual Studio VB.NET 2005 / Sandcastle treatment of <see cref=""/>
I created identical test projects in C# and VB.NET 2005, and it seems that the two compilers treat <see cref=""/> tags differently. Given this <summary> comment text in the source code: An example comment that references the <see cref="ID"/> and <see cref="Name"/> properties and also some base class library stuff like <see cref="Environment"/> and <see cref="DateTime"/>. The C# compiler produces this text in the XML comment file, which is correctly interpreted by Sandcastle: An example comment that references the <see cref="P:SandcastleTest.Program.ID"/> and <see cref="P:SandcastleTest.Program.Name"/> properties and als ...Show All
Visual Studio 2008 (Pre-release) XamlWriter with Xaml and Codebehind
I'm stuck on something with trying to create classes using Xaml and Codebehind C#. I'd like to create a class that looks like this: <UserControl x:Class="DesignElements.MyTest" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Grid Name="grid1"> <Rectangle Name="rectangle1"></Rectangle> </Grid> </UserControl> and the codebehind looks like this: public partial class MyTest : System.Windows.Controls.UserControl { public MyTest() { InitializeComponent(); } public Brush Color { get { return this.rectangle1.Fill; } set { this.rectangle1.F ...Show All
