AndyCourtenay's Q&A profile
Visual Studio Express Editions What should be written in order to randomize movement of a picturebox ?
If i want to make a picturebox move either to the left by 3 pixels or more wot should i write Is there an appropriate random function When it comes to generating random numbers, look no farther than the Random class (System.Random). To create an instance (with a changing seed value to ensure more randomness), we simply instantiate a copy: Random rand = new Random(DateTime.Now.Millisecond); To get a random integer value you need only call the Next() method, and to specify upper and lower bounds, just pass them in as arguments: rand.Next(1,3); When moving the PictureBox either right or le ...Show All
Visual C# No-parameter struct constructors & hiding virtual methods
1. Why do structs have a default no-parameter constructor that cannot be overridden What's the harm in overriding a struct's default constructor 2. Why would you want to hide a method by marking it "new" if it's been marked "virtual" in a base class Isn't the feature anti-OOP Why isn't NOT overriding a virtual method treated as a warning and not a lapse in judgement >1. Why do structs have a default no-parameter constructor that cannot be overridden They don't allow you to define your own default constructor because they couldn't guarantee that it would be called in ...Show All
Visual Studio 2008 (Pre-release) Accessibility of Window components
hi all, i have a window 'mainwindow', with its components in its xaml file. this window contains a textbox, which i want to access from another class. 'mainwindow' is initialized at program start, so i think there has to be an object of this class available for another class. but if i try to do something like this: mainwindow_textboxname.Text = "sometext"; i get the following error msg.: 'An object reference is required for the nonstatic field, method, or property' can anyone help to solve this problem thanks in advance... Hi Kalinkula WPF objects are essentially just regu ...Show All
Visual Studio Express Editions visual basic 2005 express instead of visual basic.net 2003 standard?
I wanted to know what some of you would do. I have visual basic 2003 standard and I recently downloaded vb 2005 express. Visual Basic .net 2003 standard cannot create class libraries(although you can work around this to do it), and you CAN create class libraries in Visual Basic 2005 express(a big help). Question: should I uninstall Visual Basic.net Standard 2003 in lieu of VB 2005 Express Seems the newer express version does more than the old standard 2003 version. And the older 2003 could be just eating up hard drive space. thanks, Andy Hmmm. I uninstalled VB.Net 2003 and installed VB.NET 2005 Expr ...Show All
Windows Forms Menu Item Character Underline
In my main menu, I designate the Projects menu with the name &Projects, so that the 'P' will be an underlined shortcut for the menu. It shows up fine in the designer, but at runtime the underlining disappears. Any ideas/workarounds Jeff Since 2001, actually. Most of my .NET work over the past couple of years has been on t ...Show All
Windows Forms Can't bind to a combobox
Hi, I'm a VisualC# beginner First I tried to bind phone numbers from a sql (msde) table to a combox with this code: this .listBox1.DataBindings.Add( "Items" ,dset.Tables[0], "" ); // First try The exception says: Cannot bind to property "items" because it's read-only Then I tried to change the text property of the comboxbox with code below. Using this I receive no exception and this item (or text ) appears in the combox: System.Data.DataRowView this .NummerBox.DataBindings.Add( "Text" ,dset.Tables[0], "" ); // Second try Binding to a gridwiev with code below works great: t ...Show All
Windows Forms Length of Deployment URL too long?
I receive an error when trying to install my CLickOnce application at the client which does not occur on any other internet connection I have tested. I suspect the issue is that the client uses internet monitoring software that inserts a lengthy path in front of all URLs. As you can see below, it inserts http://10.10.0.175/ cfru=aHR0cDovL3d3dy5kc................(etc ...) in front of all URLs Is the fact that this URL ends up being over 100 characters long the reason this is bombing I'm afraid there is no way around this unless I can get the IT dept. at the client to create some workaround that allows the client computers to bypass this ...Show All
Visual Studio Tools for Office Opening worksheet in VS 2005 RTM crashes IDE
Hello, I am experiencing constant crashes of my VS 2005 (RTM) when I do the following. All it takes to crash the IDE is to open my solutions and double click on any one of the worksheets. I can open the workbook w/o any issues in Excel and I've also reinstalled VSTO Tools for VS and the run-time. Any ideas would be much appreciated... Regards, Dima Kherson P.S. I was able to overcome this issue once before by wrapping a try and catch block around the entire code block in the ThisWorkbook_Startup event handler. This time I've tried commenting out all of the code I have in the worksheets and the workbook ...Show All
Visual Studio Team System "Index was outside the bounds of the array" on refresh Team Explorer
Hi, A message box saying that the "Index was outside the bounds of the array" pops up each time there is a refresh of the Team Explorer panel. Everything still seems to work fine though. Anyone knows what is going on I assume it is a problem at the Team server since all the Visual Studio working on that Team Project have the same message when doing the refresh. Pierre People ... your answers are pretty much confusing !! well pd42 the problem is that you are retrieving a single value (Scalar) from the database and you put it in a reader like SqlReader. Example SqlCommandName .CommandText = "Se ...Show All
.NET Development Log on as a Service right
We wrote a windows service using remoting that runs fine when running as a domain account that has local admin priviledges on the local machine. When we change the service user to no longer be part of the local administrators the service doesn't start. The user has Log on as service rights in the local security settings. Does a service user have to be part of the local administrators in order for the service to run Hi jones6, I think it takes a while for the newly assigned rights to get refreshed especially with a domain account. So I am thinking you may just need to wait and the changes w ...Show All
Windows Forms Painting Non Client Area in C#, VS.NET 2005
I would like to handle my own painting of captions and borders of windows in C#, VS.NET 2005, in order to change the standard look and feel of a Form / Window - can anyone explain how I might do this Thanks, Mikael I'm sorry but I would have to disagree here. You will have to override the WndProc and handle the NC* messages yourself. Not doing so will get you into trouble: for instance, if you paint without NonClient area, the child controls can be placed on top of the borders, and the client area will start at the form's (0,0), which is not what you want. This article explains quite thoroughly how to paint your own bo ...Show All
Visual Basic Close external exe, txt file on click from main program....
I've tried everything I've seen in here about this and nothing is doing it... Prior to venturing into coding myself (thanks to MS's letting us download Express free...) I had another coder create a couple of small utilities I designed (the GUI and functionality) as part of a bigger project/program. He never finished the project so I took it on myself... and I am still in the process of learning all the complexities...now I know I've been missing all the fun! Anyway, he did the coding in VB6. I tried to import them into VBx but there are too many language barriers so instead I have compiled them and created buttons on my main form to ...Show All
Visual Studio about inserting an icon in setup.msi file
friends can any body tell me how can we insert our company logo or an icon in setup.msi file in visual studio 2003.... this logo or icon should be visible when the setup.msi files runs.... Pabya: This forum is for Help issues, and I'm not an expert in msi, but perhaps the following page contains the info you are looking for. http://msdn.microsoft.com/library/default.asp url=/library/en-us/vsintro7/html/vbconAddingItemsToDeploymentProject.asp frame=true Michael Blome Visual C# Documentation Manager ...Show All
Smart Device Development Windows Mobile 5 Outlook 2002 contact storage location
I am having a problem with syncronizing my contacts with ACT! the pim.vol is taking up too much memory and I cannot move it to storage. I can only get around 4000 contacts to sync. My old Palm would sync all 9600 contacts. Is there a way to keep from running out of memory by moving the pim.vol file I've found the same problem! I've moved from a O2 xdaIIi WM2003 to a T-Mobile MDA-Pro running WM5. My synchronised pim.vol file is 10Mb, and it renders the MDA-Pro useless due to low memory with attendant hangs, crashes and error messages. This problem didn't exist on WM2003, so the "upgrade" to WM5 has ...Show All
.NET Development Zip files in c#
Hi, Does anyone know of a way to zip files in c#. I tried using sharplib but the compression utility that comes with XP is not able to unzip the files. I need a format that can be unzipped by this and most other compression tools since I am not sure exactly what my users will be using to unzip the files. Thanks in advance stax0711 wrote: I wonder how hard it is to zip/unzip a folder using Sytem.IO.Compression. You can do it using the System.IO.Compression namespace BUT you have to add a "small" payload. The Framework compression classes handle the ZIP-age of the data stream but you have to h ...Show All
