|
Hi, I am creating my own datagrid control, as I needed the vertical scrollbar to be thicker than standard (because this dg is targeting touch screen users). Anyway, I am overriding WndProc, seen in the code below:
protected override void WndProc(ref Message m)
{
try
{
if (m.LParam == this.VertScrollBar.Handle)
{
object result = m.GetLParam();
}
}
catch (Exception ex)
{
string test = ex.ToString();
}
base.WndProc (ref m);
}
My problem is that GetLParam takes a System.Type cls parameter, and I have no idea what I should be putting in there. Please let me know how to fix this if you know what should go there. Thanks in advance.
|
|
|
|
|
Hi!!
I am a bit confused with regards to constant variables. I have a class called something like MYGlobals (for example). In this class I want to define global variables used throughout my web project. I think there is 2 ways of doing this, or am I mistaken. For example, are the following 2 declarations basically the same thing?
public static const int C1 = 5;
public static readonly int C1 = 5;
What is the correct way to define constants?
Please help and advise!!
I appreciate your help.
Regards,
Brendan
(South Africa)
|
|
|
|
|
A constant can not be static.
public const int C1 = 5;
Be ware that the value is compiled into the code wherever you use the constant. If you change the constant you have to make sure that all code using it is recompiled. This is not a problem within a single project of course.
public static readonly int C1 = 5;
When the class is loaded the integer is created and initialized. (The initialization is done in the static constructor of the class.) The value is not compiled into the code, but referenced whenever it's used.
---
b { font-weight: normal; }
|
|
|
|
|
Hi All,
Am Harikaran from Chennai. I wanna to get some help how to get a media player control in Windows CE.NET 4.2 using c#.
Have tried with PIAs also. But, no help. If anyone has the sample code, please post it and help me out.
Am using Windows XP SP1 and .NET 1.1 environment and WinCE version 4.2.
I wanna to play some Video / Audio files in my Windows CE application using C#.
Thanks in Advance,
HRK-Chennai
looking for good future
|
|
|
|
|
Can anyone explain me about the differences between HashTable and ArrayList
|
|
|
|
|
In an ArrayList you get a dynamic list of object that are accessable by their index in the list.
A HashTable allows you to store an arbitrary key for each object. If you use an integer you increment after each add to the HashTable , then you'll get approximately what an ArrayList can do, but usually the keys are chosen differently and more appropriate to the way you want to access the HashTable entries.
For example, you could add objects to your HashTable with an object ID as key.
That way you can easily get the object for a given ID without having to run through the ArrayList and search for the object with the matching ID.
Regards,
mav
|
|
|
|
|
Hello,
This week I was given something cool to do. Take a Tablet and Ink enable our Tiff viewing app. Sounded easy. This is what I have:
1 Microsoft.Ink.InkPicture inkPic, that I’m loading with inkPic.image = SomeTiffFromFile
I’m not bothered by scaling problems yet.
This control captures Ink and saves it as Strokes and it works wonderfully. I’m trying to save the Ink into the Tiff.
This is what I have tried:
First I bring the Tiff into Drawing.Bitmap bmp = Image.FromFile(“filename”) (this is the same file I use as the inkPic.Image) Then I make a new Graphic from the Bitmap. Since Ink is made of Points (Ink.Strokes[Foreach].GetPoints(Foreach)) I figured I could do this
Graphics g = Graphics.FromImage(bmp);
for (int i=0; i{
p = this.inkPicture1.Ink.Strokes[i].GetPoints();
foreach (Point x in p)
{
g.DrawLine(pen, x, x);
}
}
bmp.Save(nameBase+".tif", System.Drawing.Imaging.ImageFormat.Tiff);
But that isn’t working.
I took the tmplate for this project from the PaperForm that came with the Tablet SDK. However it doesn’t save any thing and all the SDK examples that save save the Ink speratly from any image using Ink.ExtendedProperties.Add(guidImage, Gif);
I need the Ink burnt into the Tiff as one document.
Out prototype used a brush instead of Ink and it didn’t seem to work well. Too choppy. The InkPicture feels a lot nicer to use.
Ps. Does any one know a good comprehensive book about handling Tiff with GDI+
Thank you for any feedback
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn@shaw.ca
|
|
|
|
|
Hi,
I just want to know what ApartmentState is for? What's the difference between STA and MTA.
Thanx
|
|
|
|
|
I've checked the online docs but it didn't cleared my mind.
|
|
|
|
|
How to using System.Winfroms? I didn't found out system.winforms.dll in my machine.I had installed then .net completely.
|
|
|
|
|
I was wondering if anyone had a chance to use DockPanel Suite for dockable windows from sourceForge. I have a question about the modal feature. The problem is with a floating form (not docked). When this form throws a message box, the message box is not modal as it should be. When the form is docked, the message box displayed is modal. Is this by design or am I doing something wrong?
Thank you in advance
|
|
|
|
|
you have to take information by windows messages.
Tkae a look here:
WndPrc()
|
|
|
|
|
thanx for the answer but can you elaborate on this topic, just a bit more detail of where to start to fix this problem.
|
|
|
|
|
Hi,
I have to perform a specific action using several windows like hundreds of times. I could speed it up if could do this automatically:
When an Internet Explorer window is open, look for a specific regular expression match on the displayed content. If it is found, copy it to the clipboard and close the window.
The tool should not be triggered automatically and check on every window. It can, but it doesn't have to. I can as well focus the specific IE window and start it using a shortcut...
Just don't have a clue on what is the best way to start. Should i use win32 api calls, and which or is there a better C# (.NET) way to do it?
Thanx
|
|
|
|
|
Hello all,
I have searched alot on "Windows API hooking". Most of the articles that I found are either theoretical or out-dated (or ASM or C++/C code). What I want to do is to hook the winsock32.dll for my *almost-firewall*. Any hint where I can learn about this?
Many thanks in advance,
tmp0
|
|
|
|
|
Well, if you're trying to this from entirely from C#, then you're out of luck as it isn't possible. You're going to need something that will give you a non-managed interface for you to call into. You could look into madshi's madCodeHook at http://www.madshi.net/. I've used it before and it works, but you have to know what you're doing.
--
Joel Lucsy
|
|
|
|
|
Hello Joel,
I did find many products for *ready-to-use* API hook SDK. But I wanted to do it my self and not rely on someone's else's work.
It doesn't have to be entirely in C#.
Many thanks for your response,
tmp0
|
|
|
|
|
I have a set of points in a space (in OpelGL) and a DataGrid, in which I keep coordinates of these points. I would like to highlight a specific point in this space, whenever user gets his mouse over the row, that represents coordinates of exactly this point. How to capture this event in DataGrid (so the event that mouse is over eg. 4th row of the DataGrid)
2nd question - how to highlight a specific row in DataGrid?
thank you for your help and time
|
|
|
|
|
Hi...
How can i get the filename of my application?
I can get the startup path with the Application.StartupPath, but not the filename!
Can anyone help me?
Thanks
QzRz
|
|
|
|
|
|
Thanks, that would do it.
|
|
|
|
|
How do I play sound from raw data?
I got some a byte array that I want to be played, do I need to make it a wav to play it?
Or can it be done in another way?
Niklas Ulvinge aka IDK
|
|
|
|
|
I want to iterate thru an xml file and I'm not having any luck. I'm very new to C# so I don't know if this is even possible, but it seems to me that it should be.
I want to display the parent nodes of an xml file in a combobox. Is that so difficult? There's plenty of examples when dealing with SQL Server or Access, but is it possible to get the same functionality via an xml file?
As soon as a particular parent node is selected, I want the datagrid on the form to update itself with the selected parent node (from the combobox).
I've looked at XPath queries but I don't see how that would work in this case.
Any ideas?
|
|
|
|
|
By parent nodes I assume that you mean the elements that are direct children of the root element. Then you just get the nodes in the root element an iterate through them, adding an item in the combobox for each node.
Something like:
foreach (XmlNode node in myXmlDoc.DocumentElement.ChildNodes) {
myCombo.Items.Add(node.whatever);
}
---
b { font-weight: normal; }
|
|
|
|
|
Thanks Guffa,
That helped a lot, atleast I saw a little action from the combobox. I'm sure my XML file might need a little work though.
Here's the XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book>
<title>Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book>
<title>Harry Potter</title>
<author>J.K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book>
<title>XQuery Kick Start</title>
<author>James McGovern</author>
<year>2003</year>
<price>49.99</price>
</book>
<book>
<title>Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
I still can't get the datagrid to show only one particular book at a time. Right now it just shows all of them. Also, the combobox displays "book" 4 times.
Here's some code:
private void btnLoad_Click(object sender, System.EventArgs e)
{
opener.Title="Load XML Data";
opener.Filter="XML files(.xml)|*.xml";
if(opener.ShowDialog()==DialogResult.OK)
{
string myData=opener.FileName;
DataSet ds=new DataSet();
ds.ReadXml(myData);
XmlDataDocument xdd=new XmlDataDocument(ds);
xdd.SelectNodes("/bookstore/..");
foreach(XmlNode xnod in xdd.DocumentElement.ChildNodes)
{
cboBookName.Items.Add(xnod.LocalName);
}
dataGrid1.DataSource=ds;
dataGrid1.DataMember="book";
}
}
This is almost working, except for combobox displaying "book" 4 times over and the datagrid showing everything instead of just info for selected combobox item.
Sorry for the long post
Regards
Dan
|
|
|
|