|
John Simmons / outlaw programmer wrote: some folks don't appreciate the irony
Now John... let's be a little bit reasonable here.... after all with the economy the way it is, most people can't afford to buy a clue.... Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
hi ppl ,
I am using Ent Lib for validation in my windows forms application. I have a set of comboboxes which are bound to a datasource. When the selectd value is null the validations happens on it. but when I select a item from the dropdown , I am getting a validation error as "The supplid value could not be converted to the target property type".
I have defined a "Not Null Validator" for the combobox selected value in the enterprise library validation.
Help would be appreciated.
Thanks
|
|
|
|
|
|
Hi All,
A bit of background on what and why I am trying to do this. I have a 3rd party c# component embedded in my form. The component controls the cursor when the mouse is over it. I can set different cursors for the component when I initialise it but they must be mono-chrome as this is all it can handle. The component also does not process right-click menu clicks, but I have managed to circumvent this using a mouse and keyboard hook to process these actions.
Ideally what I would like to do is something similar with the mouse cursor - ie trap when the component is changing it's cursor according to the action being performed then selectively repaint the cursors with my own versions. I really need to be able to listen for some sort of event being raised I think.
Does anyone know if this is even possible? Any code or links?
Many Thanks.
|
|
|
|
|
There is no notification that the mouse cursor was changed by an outside process. Since it can change just moving from control to control or window to window, this would get very tedious to handle.
I don't know of any way you're going to be able to handle this.
|
|
|
|
|
OK Dave, Thanks for the response. It's not the answer I wanted to hear though :{, I had hoped there was some way.
Regards
Mark
|
|
|
|
|
Hello,
i have an application where my user changes font and font color for different labels etc and they save it to a file but i need to be able to convert the font of the specified label to a string to be written to file, and then when they open that file my program will convert that string back into a font object. How can this be done? I haven't found anywhere that shows how it can be done.
thank you
bael
|
|
|
|
|
You have to do this yourself by creating a data structure or string that contains all the font characteristics. You then write that alongside your text, and when you read the file back, reinterpret the font details to display the text in the way you want.
MVP 2010 - are they mad?
|
|
|
|
|
When I try to use "Matrix" or "RotateTransform" Visual Studio complains that "type or namespace" could not be found. Do I need to install the DirectX SDK for these namespaces? MSDN reveals nothing helpful, and I cannot find anyone else having this problem.
I am simply trying to rotate a GDI object. Any help would be great, this has stumped me.. .
here are the namespaces I am using;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
|
|
|
|
|
You need to use following namespaces
System.Drawing.Drawing2D
System.Windows.Media.RotateTransform
|
|
|
|
|
|
The MSDN documentation always lists the namespace you need, see here[^].
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. [The QA section does it automatically now, I hope we soon get it on regular forums as well]
|
|
|
|
|
Omg, so it is! Now I feel really stupid.. case of hurrying to find the code and failing to actually *read* the page. =)
|
|
|
|
|
When you type a "known" type into VS, Intellisense helps you by putting a red line under the final character. Hover the mouse over this, and the options for binding appear, listing the namespace required: add the using, or explicit reference. (You can get the red line back by placing the text entry caret anywhere in the type name.)
If Barbie is so popular, why do you have to buy her friends?
Eagles may soar, but weasels don't get sucked into jet engines.
If at first you don't succeed, destroy all evidence that you tried.
|
|
|
|
|
That sir is an excellent tip! Having removed the 2d namespace and typing "Matrix" intellisense did indeed highlight the last letter and popped out on click "System.Drawing.Drawing2d.Matrix" =) Wow, all these things telling me what namespace to use and I didn't see any of them!
|
|
|
|
|
Dear Friend,
Scenario
I have one grid view showing user access model having field as 'User'(Textbox), 'Group'(Dropdown), 'View' (Checkbox), 'Edit'(Checkbox) column.
I have on Data Set where i stored the data fetch from database.
now i bind this dataset to Grid View Control
DataSet ds = getData();
GridView1.DataSource = ds.Tables[0];
GridView1.DataBind();
Note: Where getData() method fetch the data from database.
Problem
i change only two record from all ten records, now i want to update only that record in my database how could i do this...
Actually i know DataSet having HasChange() Method which use to know the changes in dataset but dont know how to use it for the above scenario..
Please help me
Thanks and regard's in advance
Sasmi
|
|
|
|
|
|
Look how i use it here
http://www.codeprojecCoding an N-Tier Application in C# Without Any Wizard: Part II[^]t.com/KB/cs/N-Tier22.aspx
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
i'm trying to identify the currently open ports in a remote pc that is in the network, one solution is to check each port , but not efficient, i found IPGlobalProperties , but this allows on the local pc's port and other information , is there any solution for my need using something like IPGlobalProperties .
|
|
|
|
|
There is no solution other than the unreliable approach of "pinging" each port on the remote PC.
Unless, of course, you can upload an .EXE to the remote PC and execute it, reporting back to your machine, but I get the feeling this is highly unlikely.
|
|
|
|
|
For the past few weeks iv been working on a C# app to record from a webcam and make notes on it via button presses during said capture. The problem now is that by default the app freezes during capture, and stops capturing with a mouse click. I know that i need to change it using the captureparms structure which holds information on the default behaviour of the capture, but my attempts up to now just dont work. My sendmessage to set the capture parameters is successful and returned true when i put in code to check, so it leaves me a bit stumped and im thinking it must be something related to me doing the structure wrongly. Is there any chance anyone could help shed some light on why it isnt working?
CAPTUREPARMS CaptureParams = new CAPTUREPARMS();
CaptureParams.fYield = 1;
CaptureParams.fAbortLeftMouse = 0;
CaptureParams.fAbortRightMouse = 0;
CaptureParams.dwRequestMicroSecPerFrame = 66667;
CaptureParams.fMakeUserHitOKToCapture = 0;
CaptureParams.wPercentDropForError = 10;
CaptureParams.wChunkGranularity = 0;
CaptureParams.dwIndexSize = 0;
CaptureParams.wNumVideoRequested = 10;
CaptureParams.fCaptureAudio = 0;
CaptureParams.fMCIControl = 0;
CaptureParams.fStepMCIDevice = 0;
CaptureParams.dwMCIStartTime = 0;
CaptureParams.dwMCIStopTime = 0;
CaptureParams.fStepCaptureAt2x = 0;
CaptureParams.wStepCaptureAverageFrames = 5;
CaptureParams.dwAudioBufferSize = 0;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
public struct CAPTUREPARMS
{
public System.UInt32 dwRequestMicroSecPerFrame;
public System.Int32 fMakeUserHitOKToCapture;
public System.UInt32 wPercentDropForError;
public System.Int32 fYield;
public System.UInt32 dwIndexSize;
public System.UInt32 wChunkGranularity;
public System.Int32 fCaptureAudio;
public System.UInt32 wNumVideoRequested;
public System.Int32 fAbortLeftMouse;
public System.Int32 fAbortRightMouse;
public System.Int32 fMCIControl;
public System.Int32 fStepMCIDevice;
public System.UInt32 dwMCIStartTime;
public System.UInt32 dwMCIStopTime;
public System.Int32 fStepCaptureAt2x;
public System.UInt32 wStepCaptureAverageFrames;
public System.UInt32 dwAudioBufferSize;
public void SetParams(System.Int32 fYield, System.Int32 fAbortLeftMouse, System.Int32 fAbortRightMouse, System.UInt32 dwRequestMicroSecPerFrame, System.Int32 fMakeUserHitOKToCapture,
System.UInt32 wPercentDropForError, System.UInt32 dwIndexSize, System.UInt32 wChunkGranularity, System.UInt32 wNumVideoRequested, System.Int32 fCaptureAudio, System.Int32 fMCIControl,
System.Int32 fStepMCIDevice, System.UInt32 dwMCIStartTime, System.UInt32 dwMCIStopTime, System.Int32 fStepCaptureAt2x, System.UInt32 wStepCaptureAverageFrames, System.UInt32 dwAudioBufferSize)
{
this.dwRequestMicroSecPerFrame = dwRequestMicroSecPerFrame;
this.fMakeUserHitOKToCapture = fMakeUserHitOKToCapture;
this.fYield = fYield;
this.wPercentDropForError = wPercentDropForError;
this.dwIndexSize = dwIndexSize;
this.wChunkGranularity = wChunkGranularity;
this.wNumVideoRequested = wNumVideoRequested;
this.fCaptureAudio = fCaptureAudio;
this.fAbortLeftMouse = fAbortLeftMouse;
this.fAbortRightMouse = fAbortRightMouse;
this.fMCIControl = fMCIControl;
this.fStepMCIDevice = fStepMCIDevice;
this.dwMCIStartTime = dwMCIStartTime;
this.dwMCIStopTime = dwMCIStopTime;
this.fStepCaptureAt2x = fStepCaptureAt2x;
this.wStepCaptureAverageFrames = wStepCaptureAverageFrames;
this.dwAudioBufferSize = dwAudioBufferSize;
Sorry about the length but without providing this i dont think anyone would really have known what i had done.
|
|
|
|
|
Dear friends,
i have a shape like these ........
Path Name="MainBrush" Data=" " Margin="0,0,-5,6">
Path.Fill>
LinearGradientBrush MappingMode="Absolute" StartPoint="141.363,201.300" EndPoint="141.363,252.324">
LinearGradientBrush.GradientStops>
GradientStop Offset="0.00" Color="#ffffffff"/>
GradientStop Offset="1.00" Color="#ff020202"/>
/LinearGradientBrush.GradientStops>
LinearGradientBrush.Transform>
MatrixTransform Matrix="1.000,0.000,-0.000,-1.000,-81.196,252.324" />
/LinearGradientBrush.Transform>
/LinearGradientBrush>
/Path.Fill>
/Path>
(sorry i could not poste the code correctly so i have removed first "<" in all the lines)
i want to change these colours at runtime (in C# event) .... i am new to WPF ........i do not know how to modify these two colous at run time
help me ..........
By
Joe.I
|
|
|
|
|
First: To paste it correctly, use the "encode HTML tags when pasting" option below the message entry box - this replaces the < and > characters with more protable ones.
Second: Try the correct forum - there is one for WPF where you will probably get better help than a dedicated C# forum.
If Barbie is so popular, why do you have to buy her friends?
Eagles may soar, but weasels don't get sucked into jet engines.
If at first you don't succeed, destroy all evidence that you tried.
|
|
|
|
|
|
See following thread. There is code that will animate the color.
It is in code-behind though, but maybe it's useful.
WPF Forum[^]
hope this helps.
(ps: The code in the thread combines two animations, strip out the color animation)
|
|
|
|