|
Paul,
I know how to use Select with DataTable. I couldn't find any example for LIKE operator from the link that you specified.
Could you please point out specific example out of that link.
Thanks
Ruchi
|
|
|
|
|
Hi, I'm trying to connect to my tv tunner but I don't get any sound. It doesn't allow me to change Audiosource (it's always at SPDIF). There's no way to do it. I have tested my app and the Capture application sample in other computers, with exactly the same result: good video but no sound.
What Am I doing wrong? Neither sample app works to me and my friends...
Thank you
|
|
|
|
|
Well, I've solved it manually by changing settings at the Video Crossbar properties page.
How can I do it programatically?
Thx
|
|
|
|
|
Hi,
In MFC we had a very nice feature where in we can split the form. Can we do the same thing here. I am designing something like Visual Studio, with tool box on one side and a form (actually a plain user control) where in the tools can be dragged and dropped on the form. But when the forms size is increased, as it is a single view we cannot view the tool box. I was hoping to make something so that the tool box and a property grid stay where they are and the form can be resized in a different view.
I may not have explained few things clearly. If you need more info, pls do write and i will try to explain as much as possible. In short its a visual studio, where in i want the tool box at one side not disappear from screen when the design forms size is increased .
Thank you all.
|
|
|
|
|
Hi!
A split form can be achieved with a Splitter (thus the name ) control.
For example, if you add a TreeView , a Splitter and a ListView to your form and set the Dock property of the TreeView and Splitter to Left and the ListView 's Dock to Fill then you get the window layout of Windows Explorer.
You might have to play with the order of your controls so that the splitter behaves correctly.
Regards,
mav
|
|
|
|
|
Hi,
Thanks for the reply mav. I have seen examples with splitter and they all deal only with list view and tree view. I tried to use it with other controls (some user controls ) but was not successful. Please let me know if it can be done with controls other than listcontrol, tree control.
Thanks
|
|
|
|
|
The Splitter can be used with any two controls, you'll just have to take care that both controls are docked, one of them has docking style Fill and that the order of controls is correct.
mav
|
|
|
|
|
|
I have been searching around and have not found anything to directly show how to bind a dataset to a datagridview in C#. This is what I have so far....
string mySQLCommand = "SELECT * FROM unit where status = 1";
SqlDataAdapter myDataAdapter = new SqlDataAdapter (mySQLCommand,mySQLConnection);
myDataAdapter.Fill(myDataSet, "unit");
I was looking for a way at this point to do something like
myDataGridView.SetDataBinding(...)
But have not found anything pointing in this direction. Has anyone done this before and is it as easy as I keep reading about?
Thank you in advance...
|
|
|
|
|
I have a .NET EXE, and I have a .NET DLL, which is running as an Explorer Bar (under IE). I'd like to call a method in the active Explorer Bar in order to pass data from the EXE to the Explorer Bar. They are both running on the same computer, but in different processes.
It would seem like this is a task for .NET remoting, but I don't really want to establish a channel for each Explorer Bar, and besides, this aspect isn't critical.
So it seems that maybe this task is better suited for COM? Can someone confirm or reject this? I thought .NET was going to kill COM, but in this case, it seems that COM is more appropriate than .NET remoting.
Thanks,
Arun
|
|
|
|
|
I have a table where the fields are 'CustID' and 'CustName'. In a
checkedListBox control on winforms, I want to display 'CustName', but when a user selects 'CustName', I want to get the selected 'CustName''s 'CustID', so that I can run the query on 'CustID' and display 'CustName', how can this be done. or how to add more than one column in a checkedlistbox control, which displays 'CustName' and 'CustID'.
I really appreciate ur help.
Thanks,
abhi
|
|
|
|
|
Hi...
I have a string that contains some text... as most string does...
My string could look like this
string whatever = "Hello \n I come from a city!";
But i want to save it to a textfile!
i thought about making it to a byte and save it with the streamwriter!
but i dont know how to do it!
Can anyone tell me how to save a string to a txt document?
QzRz
|
|
|
|
|
I would suggest reading on MSDN, in particular the System.IO Namespace[^] and Working with I/O[^] in the .NET Framework Developer's Guide. The following is a quick example:
using(StreamWriter s = new StreamWriter("file.txt"))
{
s.WriteLine("Hello");
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
Thanks... it works just great now...!
QzRz
|
|
|
|
|
Just use the overload of SteamWriter's Write method which takes a string as parameter.
www.troschuetz.de
|
|
|
|
|
Hello,
I would like to simulate CMYK printing by drawing four halftoned images on the screen, one after the other, as a printing press would do, i.e. print cyan, then magenta, then yellow and finally black. Now, If I use:
g.DrawImage(cyanImage, 0,0);
g.DrawImage(magentaImage, 0,0);
g.DrawImage(yellowImage, 0,0);
g.DrawImage(blackImage, 0,0);
the white pixels of an image will paint over the previous colors. If I use alpha blending, colors will be merged, but they unfortunately become fainter by the aplha factor.
What I would like to see happening is to draw one image on the graphics or canvas such that only these pixels of that image will be painted which are above a certain threshold, i.e. not blank, or the areas where in a real printing role the paint would be.
Alternatively, I could combine these images, like professional tools can do. Then it would be sufficient to draw the combined image.
How could I achieve that in C# using the Graphics/Imaging classes?
What I started doing is the following code. Thanks for any hints.
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Imaging;
using System.Data;
using System.Windows.Forms;
namespace MergedImages
{
public class MergedImage : System.Windows.Forms.UserControl
{
private System.ComponentModel.Container components = null;
private System.Drawing.Image cyanImage;
private System.Drawing.Image magentaImage;
private System.Drawing.Image yellowImage;
private System.Drawing.Image blackImage;
public MergedImage()
{
InitializeComponent();
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Component Designer generated code
private void InitializeComponent()
{
cyanImage = Image.FromFile(@"c:\tmp\cyan.bmp" );
magentaImage = Image.FromFile(@"c:\tmp\magenta.bmp");
yellowImage = Image.FromFile(@"c:\tmp\yellow.bmp" );
blackImage = Image.FromFile(@"c:\tmp\black.bmp" );
//
// MergedImage
//
this.BackColor = System.Drawing.Color.White;
this.Name = "MergedImage";
this.Size = new System.Drawing.Size(620, 620);
}
#endregion
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
g.Clear(this.BackColor);
float[][] ptsArray ={
new float[] {1, 0, 0, 0, 0},
new float[] {0, 1, 0, 0, 0},
new float[] {0, 0, 1, 0, 0},
new float[] {0, 0, 0, 0.25f, 0},
new float[] {0, 0, 0, 0, 1}};
ColorMatrix clrMatrix = new ColorMatrix(ptsArray);
ImageAttributes imgAttributes = new ImageAttributes();
imgAttributes.SetColorMatrix(clrMatrix,
ColorMatrixFlag.Default,
ColorAdjustType.Bitmap);
g.DrawImage(cyanImage, 10,10);
g.DrawImage(magentaImage, 110,10);
g.DrawImage(yellowImage, 210,10);
g.DrawImage(blackImage, 310,10);
g.DrawImage(cyanImage, 0,0);
g.DrawImage(magentaImage, 0,0);
g.DrawImage(yellowImage, 0,0);
g.DrawImage(blackImage, 0,0);
g.DrawImage(cyanImage,
new Rectangle(300,300, cyanImage.Width, cyanImage.Height),
0, 0, cyanImage.Width, cyanImage.Height,
GraphicsUnit.Pixel, imgAttributes);
g.DrawImage(magentaImage,
new Rectangle(300,300, magentaImage.Width, magentaImage.Height),
0, 0, magentaImage.Width, magentaImage.Height,
GraphicsUnit.Pixel, imgAttributes);
g.DrawImage(yellowImage,
new Rectangle(300,300, yellowImage.Width, yellowImage.Height),
0, 0, yellowImage.Width, yellowImage.Height,
GraphicsUnit.Pixel, imgAttributes);
g.DrawImage(blackImage,
new Rectangle(300,300, blackImage.Width, blackImage.Height),
0, 0, blackImage.Width, blackImage.Height,
GraphicsUnit.Pixel, imgAttributes);
}
}
}
|
|
|
|
|
|
Code using Windows/Web Forms have both "Code View" and "Design View". AFAIK, the IDE knows when to provide the "Design View" by checking the first class declaration in the codefile.
What if I create an alternate editor for a codefile, something like "Design View", is it possible to integrate it into the IDE? If so, can anyone give me a pointer or two to an article or documentation?
-Maki
|
|
|
|
|
Hey,
This is driving me up the wall!
I have a set of 3 grids.
They bind correctly as follows
//Parent Grid
dataGrid1.DataSource=parent;
//Child Grid
dataGrid2.DataSource=parent;
dataGrid2.DisplayMember="Parent.Child";
//Grand Child Grid
dataGrid3.DataSource=parent;
dataGrid3.DisplayMember="Parent.ChildToGrandChild";
The relation works beautifully.Been working for months now.
Here is the issue:
I have to filter out data in the child grid ie dataGrid2, which in turn will affect dataGrid3 which is fine.
so I have tried using the RowFilter property of the DefaultView exposed by the DataTable, but to no avail.
These are the methods i have tried.
1. ((System.Data.DataTable) dataGrid2.DataSource).ChildRelations["Parent.Child"].ChildTable.DefaultView.RowFilter = " [FilterMeNow] = 1";
does not work.
2. I tried setting up the filter before establishing the databinding but after the relation is set, again it wont work.
3. Googling it leads to me to think setting the row filter is the way to go....but nothing seems to happen.
I know RowFilter works because I have been using it for single grid all year long.
So how do i go about using it in master-child relation datagrid.
Am I just supposed to refresh the grids after they are bound, resulting in the row filter to take affect. If so, how?
A frusturated Looney Tunezez
Cheers!
<bold>Looney Tunezez
"If you build it....
.....BUGS will come!" -JB
Application.Run(new Form1(this.Dispose())); <--WHAT :wtf::confused::eek:
"Stability. What an interesting concept" - Chris Maunder
<bold>
|
|
|
|
|
Does anyone know how to clear the clipboard so that neither Windows or Office can use what was copied?
|
|
|
|
|
If your using the Clipboard class, all you need to do is use the SetDataObject(object, bool); version of SetDataObject . The bool parameter tells the clipboard wheather or not to clear its contents when your application exists.
If you wanted to clear the clipboard at the click of a button, or other control, then you'll have to P/Invoke the Win32 OLE function OleSetClipboard[^]. It takes a single parameter, a pointer to an IDataObject , but in order to clear the clipboard, you'll pass in null .
[DllImport("ole32.dll")]
static extern int OleSetClipboard(IDataObject pDataObj);
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
In my application there is requirement that once the application is started then other opened windows on desktop should not be visible to the user.
I want to know if there is any way by which I can minimize all the open windows (on desktop).
|
|
|
|
|
Yes, however you will need to P/Invoke several Win32 functions. Your P/Invoke statements will look like the following:
const Int32 SW_HIDE = 0 ;
const Int32 SW_SHOWNORMAL = 1 ;
const Int32 SW_NORMAL = 1 ;
const Int32 SW_SHOWMINIMIZED = 2 ;
const Int32 SW_SHOWMAXIMIZED = 3 ;
const Int32 SW_MAXIMIZE = 3 ;
const Int32 SW_SHOWNOACTIVATE = 4 ;
const Int32 SW_SHOW = 5 ;
const Int32 SW_MINIMIZE = 6 ;
const Int32 SW_SHOWMINNOACTIVE = 7 ;
const Int32 SW_SHOWNA = 8 ;
const Int32 SW_RESTORE = 9 ;
const Int32 SW_SHOWDEFAULT = 10 ;
const Int32 SW_FORCEMINIMIZE = 11 ;
const Int32 SW_MAX = 11 ;
[DllImport("user32.dll")]
static extern int ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("user32.dll")]
static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam);
delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam);
[DllImport("user32.dll")]
static extern bool IsWindowVisible(IntPtr hWnd);
The implementation part would look something like this if you were invoking this from a button click:
private void bClick(object sender, EventArgs e)
{
EnumWindowsProc proc = new EnumWindowsProc(MinimizeWindow);
EnumWindows(proc, IntPtr.Zero);
}
private bool MinimizeWindow(IntPtr hWnd, IntPtr lParam)
{
if(IsWindowVisible(hWnd))
ShowWindow(hWnd, SW_SHOWMINIMIZED);
return true;
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hello..
Plz could any one help me on how to embed a numeric updown column in a DataGrid..
And thanks..
bhshs
|
|
|
|
|
Does anyone know the equivalent of
SetWindowExt
SetViewportExt
in C#.
I have an old dll that i need to use which draw object to a device context using the resilution of the device, this is fine where the device is a screen e.g 96dpi but if I use my printer 1200dpi then the object being displayed is tiny, so I would like to scale it up by a factor of deviceDPI / 96.0.
does anyone know hoe to do this
|
|
|
|
|