Kailai's Q&A profile
Windows Forms Problem with inherits form
I am trying to modify my existing form to use a new base form. In my new base form, I have added the following property. <DefaultValue(False)> _ Public Property TrainingMode() As Boolean Get Return Me.trainingLabel.Visible End Get Set(ByVal value As Boolean) Me.trainingLabel.Visible = value End Set End Property I use the trainingLabel visibility to indicate whether my system is in training mode. In the base form designer view, I have set the trainingLabel.visible to false. The problem is those inherited form based on the previous base form will change the TrainingMode to true automatically after I rebuilt the base form. I don't know how to debug this problem. As all this happened during the design ti ...Show All
Visual C# Close() & Dispose(): which one or both?
In relation to ConnectionString property: shall I Close() it or Dispose() of it or both More generally for SqlConnection - the same question: what is the proper way SqlCommand give only a Dispose() option, I guess There is nothing to Close in there, right Thank you. I don't understand what do you want to do with the ConnectionString property. It's a string, you do not need/cannot Close/Dispose it. As for the SqlConnection: Quote from the MSDN docs for SqlConnection.Close(): " If the SqlConnection goes out of scope, it is not closed. Therefore, unless you have placed your code inside of a using statement, you must explicitly close the connection by calling Close or Dispose . They are functionally equivalent ...Show All
Visual Studio Express Editions Create popup menu "VB Express"
HI How can i create a popup menu for RichTextBox For example, when i'm clicking with the right mouse button in any part of RichTextBox, That most dispaly a popup menu. I have written this code, but it's not working Private Sub RichTextBox1_MouseClick( ByVal sender As Object , ByVal e As System.Windows.Forms.MouseEventArgs) Handles RichTextBox1.MouseClick If e.Button = Windows.Forms.MouseButtons.Right Then MnuPopupToolStripMenuItem.ShowDropDown() End If End Sub If someone knows how to create this menu, I would appreciate. Thanks Drag a context menu strip from the toolbox onto the main form. (It will park itself underneath the form.) Go to the richtextbox properties ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Transparent Controls
I know this is a bit out of the context of this forum, but yet i believe you are the only people how can really help me. I Have a D3D application. i have a texture streched over the entire window. i want to add a transparent text box to the app. I've tried to set the textbox backcolor to transparent, but it dosen't work (I don't know how transparent is implemented, it's good enough for GDI, but not good enough for D3D). One thing is setting the textbox backgroundimage to a portion of my texture, but i don't like it so much. i'm looking for a true transparent contorl here. Any suggestions thanks. ...Show All
Commerce Server Biztalk Catalog Integration
Is it possible to setup the Biztalk integration with the Catalog Manager to delete variants when importing with Incremental changes. I have tried creating the XML file with the variant I no longer want not present in the file but if I go into catalog manager I can still the variant after import. Please Advise. I have used following xml to import using catalog send adapter, still it did not delete the variant from catalog. This works if i import through catalog manager. < xml version="1.0" encoding="utf-8" > < MSCommerceCatalogCollection2 version =" 3.0 "> < Catalog languages =" en-US " name = ...Show All
Visual Studio Tools for Office Problem filling data island nodes
Hello all, I have a project that allows user's to create a word document via a web page. (based on a word document that has a customization, and an attached xml schema) I am at the point where I am populating the word document xml nodes with data from the data island, but only one set of nodes is being populated. Here is an excerpt of the code that populates the data: for (int i = 0; i < this.Controls.Count; i++) { object ctrl = this.Controls ; if (ctrl.GetType() == typeof(XMLNode)) { XMLNode node = null; node = (XMLNode)(this.Controls ); try { if (!node.HasChildNodes) { ...Show All
Visual Studio 2008 (Pre-release) How to capture client's infomation on server process?
Hi Eveyone, I have a wcf service runs on the server as a console application (sefthost). Currently, I have many clients connect to that service and all of them work very well. Now I try to improve my system a little bit by trying to capture client’s info whenever a client requests the service on the server to do something. Does anybody have any example or any ideal how to do this Thanks in advance. Jdang You'd have to add an application header on the client side and then read it on the server - there's no built in way to see where the client is connecting from. On the client, when sending the message, do something like: using ( OperationContextScope scope = new Operati ...Show All
Windows Forms Why does ATL contorl receive WM_DESTROY mesage when it's loaded from a form in MDI App?
I have an ATL activeX control, and I want to put that control into a child form in my C# MDI App. When I click "show child" menu, my child form should show up correctly. But my ATL control receives WM_DESTROY when it's loaded, and this is only happend in C# MDI enviroment. I trid to load it from MFC MDI app, it's fine. In my WM_DESTROY message handling, I want to do some final clean up,and I don't want it to be done when it is just loaded. Thanks for any help! Here is my code: ATL: created from "Visual C++ Projects--> ATL --> ATL Project" and the control typ is just a "Standard control". LRESULT CMyAtlControl::OnDestroy(UINT /*uMsg*/ , WPARAM /*wParam*/ , LPARAM /*lParam*/ , BOOL&am ...Show All
Visual Basic Date.Parse Can't Read "P" or "A" for "AM" or "PM"?
I'm a bit baffled at something. The following code passes: Date.Parse("10 PM") But the following throws an exception: Date.Parse("10 P") I find this to be weird because in the ToString, the format string allows: Dim d as Date = #10:00:00 PM# Console.WriteLine(d.ToString("hh t")) That will output "10 P" It seems like a shortcoming that it can't process something that it can output so simply. Unless I'm missing something Why do they even include a single letter format if they don't recognize it as part of a valid time try with: Date .ParseExact( "10 P" , "hh t" , Globalization.CultureInfo.GetCultureInfo( "en-us" )) ...Show All
SQL Server Output 10 rows
Hi! I am a newbie, need to make a report with only 10 rows, and not the whole result. How do I actually specify the output as 10 rows Thank you so much in advance! Depends on your exact circumstances. If you want show 10 per page then you need to put a list control in the body put your table inside the list control add the following grouping expression to the list control =Ceiling(RowNumber(Nothing)/10) make sure you mark the check box to add a page break at the end Or if you just want to return 10 rows then you could do this in your source query In SQL SELECT TOP 10 x, y, z, FROM table_name In MDX SELECT {[Measures].[x]} on Columns, TopCount(<<Set>>, 10, <<value& ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Help Please, kinda alot of questions in here
Hi, im a complete beginner with any kind of coding and i want to make a simple game to start learning how to code. I'm very fluent in 3ds max and want to put some use to the models i've made and put them in my own game... I want to make a simple space ship flight game. I've done the 3 tutorials for moving models but I dont really know how to apply them to my own game. heres mainly what i want; 1. I want the camera to rotate around my model using the right thumb stick. 2. the gun on top of the ship to rotate with the camera view. (when you look up and down the guns would aim up and down etc.) I have bones going through the gun on the model. 3. want to press up or down on the d-pad to toggle 3 different speeds. 4. steer the ship with the lef ...Show All
Visual Basic Can't close Excel with VisualBasic 2005
I'm using excel.application in visualBasic 2005, and I don't manage to close it. I tried some solutions found on the net, and appart the one killing the processus "Excel" in the task manager, no solution seem to work. In this simple example, Excel disapear from the task manager, but with the line in comment activated, excel stays open. Launching the function a second time create a new Excel Process, but close it after (one is still staying in the task manager). Please, help me to close the processus. Dim xlsheet As Excel.Worksheet Dim xlBook As Excel.Workbook Dim xlapp As Excel.Application Private Sub Button1_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click ...Show All
Visual Studio Team System Tracking requirements, scenarios & tasks through iterations
I think I know the answer to this question having read some of the answers on this forum...but I'd like to make sure I have this is clear in my mind. In the MSF for CMMI process there are requirements, scenarios and tasks (plus other work items). In a development there will be multiple iterations to develop various features of the system. I would like to be able to track a requirement to its implementation in one or more of the iterations. I'm assuming that I would analyse the requirements to create scenarios and link them together (e.g. "customer creates wibble" and "customer views wibble history" being two scenarios that fufil the "customer's can manage their wibbling" requirement). From the scenarios ...Show All
SQL Server stop sql server service
I program a batch file for SQL server2000 disarstrer recovery. It just stops sqlserver service and copy data file to a flash drive, then restart service. sc \\S-HKRGCT\TMA stop sqlagent$trips timeout /t 50 sc \\S-HKRGCT\TMA stop mssql$trips timeout /t 20 REM del \dbyestoday\*.* /q REM move \yestoday\*.* \dbyestoday\ REM move \today\*.* \yestoday\ REM cd \today REM copy d:\tma\sql_data\ REM sc start mssql$trips REM sc start sqlagent$trips When it run first line, shown: sc openScmanager Failed 1722. The RPCservice is unavalible." Does batch file can stop service Any help is welcome. Peter Hi Jens, Thank you very much. It solved my problem. But when I tried ...Show All
Windows Forms DataGridView: Select Rows and retrieve the values of the cells
Language: VB.NET 2005 Framework: 2.0 Database: SQL Server Express 2005 I have a DataGridView that is populated with data from a SQL Server DB. I need to allow the user to select Rows of interest and then the values of some of the cells on the selected Rows needs to be retrieved for Math calculations. I can retrieve values from cells I just need to know how to get VB to notice that a Row has been selected and only retrieve the vallues on the selected Rows. How to retrieve Values from a DataGridView - May Help Someone OutPut = DataGridViewName.Item(columnIndex As Integer, rowIndex As Integer).Value.ToString txtOut.Text = grdCboTest.Item(3,0).Value.ToString Thanks in advance for any help, Mike ...Show All
