Paul from Arcadia's Q&A profile
Windows Forms Vertical Positioning in a RichTextBox
I have an app (written in C#) with a RichTextBox control. Programmatically, I search for and select a chunk of text with the following code: rtbEdit.SelectionStart = rtbEdit.Find("u#10"); rtbEdit.SelectionLength = intUtteranceTextLength; This works fine except that the selected text is at the bottom edge of the box. I would like the selected text to be in the center of the box, or best of all, allow me to determine where the selected text was positioned before the search, then restore the selected text to the same vertical position. Is there any way to detect and control the vertical position of the selected text Tha ...Show All
Visual Basic How should I proceed? Advice, please.
I'm wanting to use ASP.NET 1.1 and VB.Net to develop a web based control panel for Windows environments. I will be developing on a Windows XP Pro machine but will be debugging on a Windows 2003 machine. My issue though is that I don't know where to begin. My question is where do I begin Some code samples are preferred, if possible, but I'm just looking for a direction to begin. I've done Google searches and MSDN searches for ASP.NET working with IIS but I didn't get much luck in finding anything. Thanks for your help. -Michael One question - why Why reinvent the windows control panel functional ...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
Smart Device Development Device deployment - How to prevent activesync?
When deploying PocketPC's, how does one prevent Activesync from loading (user from docking and modifying file system) Thanks! I dont quiet get the question. If you dont want it loading then why not uninstall it What is it needed for it you dont want it to load ...Show All
Visual C++ LPCTSTR
Hello all, I've got another question. I'm using a bit of code written by Nishant Sivakumar ( http://www.codeproject.com/tips/CSMTPConnection2.asp ) to send an email programmatically. The code is relatively straightforward and there are no problems during compile EXCEPT... Error 3 error C2664: 'ATL::CMimeHeader::SetSender' : cannot convert parameter 1 from 'const char [19]' to 'LPCTSTR' SetSender is a member of CSMTPConnection2, which was written by Nish and inherits from CSMTPConnection. It expects an LPCTSTR. Here's how I call it: CMimeMessage msg; msg.SetSender( "myname@address.com" ); In fact, ev ...Show All
Visual Studio Unable to install
As it did for Oct. 2005 and Feb. 2006 versions, I still get an Error Code = 2 error when I launch the VS SDK Mar. 2006. I'm using VS Team Ed. for Dev. 2005. Is there a workaround A command line parameter Something I must do before trying to install Thanks ! Leo, Thank you for the question regarding installation options for the VS SDK. We're puzzled about this problem since we haven't seen it ourselves and have not heard of other reports. To answer your question directly, you can run the self-extracting executable with the -x switch to prompt you for a location to extract to. So this would be ...Show All
Windows Forms databinding to table
Im trying to make a table using the dataGridView control. I would like it to display 4 columns, the 1st column a part name(read-only) and 3 more columns for x, y, and z coordinates. I have a class object that has a part name field and an array field that holds an array [x,y,z], so I sit here searching help and scratching my head wondering what to do. I've added data sources and drag and dropped them to a dataGridView control(I see no mention of the fields I want while doing this), so then I run into a then what situation. I am writing in C# OK, now maybe I can elaborate. I have a Car class, wh ...Show All
Windows Forms How can make the column completely viewable in a datagrid?
I am using VS2003 version, and a datagrid in it. This datagrid is dynamically populated with a dataset and the columns and the actual width of the data are unknown. Now, when I populate it, it comes with fixed column width. If I double click on the right corner of each column, it expends the width to show the text completely, just like excel spread sheet. Is there any standard feature to say - extend the column width to the max value of data, basically to automatically do the double click over each column (other than custom datagridstyle) Thanks, ...Show All
Visual Studio Team System Custom rule for investigating a switch statement
Hello I've been playing with custom rules for the last couple of weeks. In one of my rules, I'd like to investigate switch statement for the existance of a default case. I wish to obtain a list of cases within a switch statement. I investigate instruction lists of a method, but all I can find are elements with a 'switch' OpCode. Do you guys know how can I do it Any suggestions are welcome. Regards, Luke This is not possible, unfortunately, as FxCop is strictly a binary checker and many details of a switch{} construct are hard or impossible to recover from emitted IL. The C# compiler, for e ...Show All
Windows Forms Can one use an image for the actual control?
Hi. This might be a simple task for the pros but I'm far from that! Anyway, I would like to create controls such as knobs or switches etc. for my user interface. Say I want to duplicate a home stereo face or whatever. I would like to have a knob image from an actual photo then make this image rotate with adjustments an ...Show All
Visual Studio Express Editions How to burn MSVS 2005 Express CDs
Hello everyone, Due to the stupid .img format that the Offline installers are being distributed in I have decided to write up how to convert it into a .bin file which is more widely supported. My copy of Nero 6 was unable to load or recognize the .img file, and the extraction instructions on the offline installer instruction page produced a copy of VSC++ that was not installable. Okay, load up the image in ISOBuster, right click on the " CD " and select " Extract CD <Image> " then " RAW (*.bin, *.iso) ". Save the file as " IMAGE.BIN " and wait for the extraction process to complete (takes 5 mins). ...Show All
Visual Studio Express Editions MFC with VC ++ express ?
Hello, I try to compile the sample regmaid in VC ++ 2005. When linking , I have the error "mfc42d.lib not found" There is only the 64 bits version in the SDK. Where to find MFC dll and LIB Thanks for answer , ToutEnMasm 1. VC++ Express doen't contain the MFC! You need at least VS-Standard 2. The SDK contains only a 64bit version of the MFC. VC++ Express doesn't support 64bit! ...Show All
Visual Studio Express Editions Change Multiple Controls Properties via code
My form has multiple buttons (20 of them), when one is clicked it change the backcolor and forecolor. I would like to change the color of all the buttons at once. Is there an easier way to do this other than Button1.BackColor = ... Button2.Backcolor = ... Button3.Backcolor = ... You can loop through the controls collection on a form searching for a controls of a specific type. For each ctrl as control in Me.Controls if typeof(ctrl) is Button then Ctype(ctrl, Button).BackColor = .. end if Next ...Show All
.NET Development Pretty XML? should be easy can't find how!
OK, so I have a System.Xml.XmlDocument. How do I output pretty xml Shurely this is easy, but I just can't how. Alternatively, can you get just the text of a node i.e. all the text from "<" to ">", and I can do the rest myself ta Sure it's easy, when you know how Private Sub WritePrettyXML() Dim xmlWriter As New XmlTextWriter("XmlTest.xml", System.Text.Encoding.UTF8) Dim iCnt As Int16 'the following three lines makes the program do indentions xmlWriter.IndentChar = vbTab xmlWriter.Indentation = 1 xmlWriter.Formatting = Formatting.Indented ...Show All
Visual Studio 2008 (Pre-release) How to get Count in GroupBy
I tried to translate the very common sql query Select Category, count(*) as NumberOfProducts from Products group by Category into linq syntax. I was able to write it like this: var orderGroups = from p in products group p by p.Category into g select new { Category = g.Key, NumberOfProducts = g.Count() }; Question: is there a O(1) way, to get the NumberOfProducts without using the Count()-Function running presumably O(n) Thanks! Depending on the underlying server, which in all of our cases at the moment, is SQL 2005 - Counting the number of rows in a group is actually a O(1) operation. It has a fixed cost because ...Show All
