pj_bennett's Q&A profile
Windows Forms Creating a color chooser
How to create control like the one in MS Office,from which the user choose a color Or how to fill a combobox with different colors for combox you can use set combox drawmode to OwnerDrawFixed than add code at draw item event private void comboBox1_DrawItem( object sender, DrawItemEventArgs e) { Rectangle r= e.Bounds; Font f=e.Font; string s = this .comboBox1.Items[e.Index].ToString(); Graphics g = e.Graphics; g.FillRectangle( new SolidBrush ( Color .FromName(s)), r); } ...Show All
Visual Studio 2008 (Pre-release) Timeout for method in service
I have a service (InstanceContextMode.Single) that has a couple of methods accessible through a basicHttpBinding in WCF. One of these methods is a "receive"-methods" which checks for new messages. The method loops until a new message is ready, and then returns this message. A TimeoutException is thrown when the client has waited for more than 1 minute (default value) for the receive-method to return. Each time that the exception has been caught, the client calls the same method again. The problem is that the method in the service keeps running, and will return when a new message arrives, but the client never receives it. So, is it possible to stop the execution of the method in the service if the client has timed out, i.e. ...Show All
Software Development for Windows Vista MFC CSocket problem in Vista
Dear Newsgroup, I've got the problem, that CSocket::Create gets the error 0000273F (german error text: "Es wurde eine Adresse verwendet, die mit dem angeforderten Protokoll nicht kompatibel ist.") if the program uses MFC DLL in a shared library with Vista Beta2 (Build 5384). To reproduce the behaviour: - create MFC project (I've done it with VC6) - use MFC in a shared library (_AFXDLL defined!) - activate Windows Sockets Put the following code into a function: ----------------------------------------------------------------- CSocket *s = new CSocket (); if ( 0 == s->Create ( )) { LPVOID lpMsgBuf; DWORD dwErrorNo = GetLastError(); if ( 0 == dwErrorNo) return; FormatMessage ( FORM ...Show All
Visual C# Why i can't locate exceptions to specific code file and code line within vs.net2005?
In fact, I’m not sure whether this is my problem or vs. net’s problem. There is a solution which migrated from vs.net 2003 and includes several class library projects and a web project. When I build this solution, there are some exceptions appeared in Error list. But, some of them which related to the web project just have error id and the error description but without file/line information. This kind of error info makes me can't locate exception to specific code line. That’s real difficult to do debug works. Anyone ever know the same situation like that Anything I can do to solve this Thx. can't here post some sample images from out of this forum anyway, u can find the sample image here: http://illusions.zo ...Show All
SQL Server The return of Problem Assigning Value to Package Variable From Data Flow Script Component
I have a Data Flow Script Component(Destination Type) and in the properties I have a read/write variable called User::giRowCount User::giRowCount is populated by a Row Count Component previously in the Data Flow. After reading http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=97494&SiteID=1 it is very clear that you can actually only use variables in the PostExecute of a Data Flow Script Component or you will get an error "Microsoft.SqlServer.Dts.Pipeline.ReadWriteVariablesNotAvailableException: The collection of variables locked for read and write access is not available outside of PostExecute." What I need to do is actually create a file in the PreExecute and write the number of records = User::giRowCount as&nbs ...Show All
Visual Studio Express Editions How to receive current row number to use it later
I'm just learning Visual basic 2005 Express Edition and I'm writing a simple application where I use DataGrid. While navigating in it I would like to open a new form filed with the data from current row. I know there is a possibility to open a different form set on a certain position but I would need to receive the row number from my DataGrid. How can I do that or maybe there is an easiest way to set the position in the different form You can only use the SelectedRows property if you have the SelectionMode set to FullRowSelect or RowHeaderSelect. Assuming that you have, something like the following should work for you: This assumes that you have another form "Form2" which contains three l ...Show All
Visual Studio 2008 (Pre-release) problem binding IsCheckedProperty using Converter
Hi, What is the problem with this code: CheckBox box = new CheckBox (); Binding binding = new Binding (); binding.Converter = new MyValueConverter (); box.SetBinding( ToggleButton .IsCheckedProperty, binding); Where MyValueConverter is my own implementation of IValueConverter. I've used the same approach for ContentControl.ContentProperty and other properties and it has alway worked well. What is different about the ToggleButton.IsCheckedProperty The code above crashes with an InvalidOperationException. Kevin ...Show All
Visual Studio Domain model designer toolbox items disappeared
Hi, I'm going through the DSL tools walkthrough 1, and things have been going pretty smoothly until suddenly my toolbox items for the Domain Model have completely disappeared. Even if shut down VS or start a completely new DSL project, the toolbox items are still gone. Any idea why that might be or where I may have hidden them (and how I can show them again) Thank you, Notre I am also facing the same problem but doing a Toolbox reset only brings back the "Class" toolbox item in the Domain Designer. Can anyone please tell me as to how can I get the remaining items (like association connectors etc...) ...Show All
Windows Forms Problem with a customized TextBox
Hi, I've created a customized textBox which I can drag in a PictureBox (besides other functionality that works almost perfectly). But when I move my control it doesn't paint itself as it should. It makes a kind of flick. At first, I tried to solve it doing a double-buffer; but I didn't get anything, it worked in the same way. I don't know what I have to do to make it function well. Here, you have my code: public class MyTextBox : TextBox { private bool bLeftDown; private SizeF sizef; Point previousPoint; PictureBox container; public MiEtiqueta( PictureBox screen) { this .ReadOnly = true ; bIzqPulsado = false ; this .AutoSize = true ; this .AcceptsReturn = true ; //this.M ...Show All
SQL Server import ascii file with ssis and script
Hi, i've question about how to import an ascii-file in a sql 2005 table. I want to import this file also with an unique key. There i first have to get the last key form the table and then raise this key. Next step is to use this key during the import. How do i have to do this in ssis Thanks in advance Olaf Phil, Thansks for your answer, and i'm doing wel till step 'Script Component'. After i've clicked on 'script' and add 'MaxKey', i get an error message after i've clicked on button 'Design Script'. The message is: 'The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container...' What do i wrong Thanks. Olaf ...Show All
Windows Forms I want to give appropriate value to the mouse movement with c#
I want to give appropriate value to the mouse movement with c# ====================================================== int m=0; if(mouse movement == up) m=1; if(mouse movement == right) m=2; if(mouse movement == left) m=3; if(mouse movement == down) m=4; ====================================================== Just like the algorithm above, I want to make a program that gives appropriate label. And I would like if it can work out of the form(frame); I linked an example of that in c++ (and it works with keyboard) http://blog.naver.com/cianism/90013728694 I wish it could work with keboard in c# I'm a newbie in c#. I will really appreciate if you guys help me making this program. Ok, now I am confused...I think I need ...Show All
Visual Basic CheckBox Service control (VB, VS 05)
I decided to try and expand my project, I now wish to have the (current, I'm adding more as I find out which aren't required ) two processes here's a brief on what stage the additions are at. I have added 4 check boxes named; SpoolCheck1 SpoolCheck2 MDMCheck1 MDMCheck2 (more will be added as I find out more that can be stopped) and two command buttons named; StopCheckedButton StartCheckedButton I would like to 'link' the check boxes to the command buttons, but the checkboxes job (when checked, then clicking the start/stop command buttons) is to start/stop the selected program/process, in this case spool and mdm. I have these codes for starting and stopping the processes and return a message if there is a problem. ...Show All
Visual Basic Java Function Listing in VB?
I'm writing a development IDE for writing Java programs, and I was wondering: How can I retreive a list of all the function names in the source file the user's currently editing For those who don't know Java or C/C++, the function format is: public MyFunction'sDataTypeGoesHere MyFunctionNameGoesHere(ParametersGoHere) { CodeGoesHere; } What you're asking to do is fairly difficult. AFAIK, there is no free/public API available for doing this. You're essentially going to have to hand roll the solution yourself. The correct (and much harder) way to do this is to create a full lexer/parser solution. Essentially you would be building the first 2 phases of a full java compiler. The best way to get started on this appr ...Show All
Windows Forms using graphics on mdi parent form
I have found a snippet to create gradated colored rectangle that then can be a form's background, but it uses the paint event of the form: Private Sub MainMenu_Paint( ByVal sender As Object , ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me .Paint Dim rec As Rectangle = New Rectangle(0, 0, Me .Width, Me .Height) Dim myBrush As Brush = New Drawing2D.LinearGradientBrush(rec, Color.Aqua, Color.Yellow, Drawing2D.LinearGradientMode.ForwardDiagonal) e.Graphics.FillRectangle(myBrush, rec) End Sub I know how to create a colored background on the mdi parent but that code needs to be put into the load event. For Each ctl As Control In Me.Controls If TypeOf ctl Is MdiClient Then ctl.BackColor = Me.Bac ...Show All
.NET Development how to not include base class in shema
Hello I have three classes A,B,C. B derves from A and C derives from B. I only want to include A and C in the wsdl so that the client does not see B. I tried to use the [ XmlType (IncludeInSchema = false )] on B but then C wont be included either. Even adding [ XmlType (IncludeInSchema = true )] to C wont include C. How can this be done I do not want to include B and B:s properties should not be seen in C either. Thanks Ok, I see the problem now... But my answer will be quite similar to the first one..... you can keep the same code and add a dummy method with C as parameter or return value to force this definition to be in the wsdl. [ WebMethod ] public void Dummy( C dummyParam ) { // do not ...Show All
