|
You do exactly as they do in VB.NET. The entire framework is the same, it's just the language syntax that differs.
---
single minded; short sighted; long gone;
|
|
|
|
|
Ha ha ha... I read your response before having breakfast
I should have clarified my question:
The VB example I saw has this line:
Dim hBrush As Long
hBrush = CreateHatchBrush(HS_DIAGCROSS, RGB(0, 255, 0))
I could not find CreateAnyTypeOfBrush in the VS HelpIndex nor the Object Browser. Which namespace/dll/assembly does this method belong to? Or should I use a similar/different method in C#. The website I saw the above example from tells you to buy a book to get more info on the above example.
I already inserted System.Runtime.InteropServices in my using statements (based on another website I saw).
I could not translate the above code to C#. I already have been able to import the FrameRgn method from gdi32.dll, but I'm stuck with the above line of code. Please help, anybody. Thanks very much
-- modified at 21:55 Thursday 20th September, 2007
|
|
|
|
|
CreateHatchBrush is a GDI method:
MSDN Library: CreateHatchBrush[^]
A search on pinvoke.net[^] gave this declaration:
static extern IntPtr CreateHatchBrush(int fnStyle, uint clrref);
A search for "C# CreateHatchBrush"[^] gave a page as the first hit containing this code:
[DllImport("gdi32")]<br />
public static extern int CreateHatchBrush(int nIndex, int crColor)
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanks Guffa.
I should have known the method is from the same dll.
But when I added the methods and passed the value returned by CreateSolidBrush to FrameRgn, it still wasn't drawing the border. I'm passing the right values to CreateSolidBrush but I think I'm passing some wrong info to FrameRgn.
I didn't want to spend anymore time on it. So I decided to just draw the border myself using the same graphicspath I'm using to clip the region. I just used a slightly thick pen so it still shows after the clipping. Simpler and less hassle.
Cheers.
|
|
|
|
|
hi,
It would be quite an important thing for the user to get the data back in the order as it appears in the datagridview. rows of data are got from other gridviews (user clicks on other grids' rows and rows are copied to the gridview in question)
so... no problem until user adds rows from the beginning(0 rows), and then saves his data, but:
if user add rows the deletes rows then adds the same row again and save, the newly added row appears the first, however it was added the last. (BindingSource.Endedit is called each operation)
any idea?? I also tried the BindingSource.ResetBindings() method, but that didn't helped.
for saving tableadapter.update() is called.
thx, g
|
|
|
|
|
Did you know that databases do not care about the order of records in a table?? Unless told otherwise with a ORDER BY clause, a SELECT statement can return records in any order.
About the only way to accomplish this would be to give each record in the table an index number specifying which row in the view it is in. When you write the data back out to the database, you'd have to include this view order number with the data and store it in it's own column in the table. When you retrieve the data again, you'd have to specify and ORDER BY clause on that view order column in the SELECT statement, thereby guaranteeing that you get a table sorted in the order the user last saw it.
|
|
|
|
|
thx that gives me the idea....
now only 1 question left.for the accomplish of the above is it OK to have an [int-increment 1 ] identity (primary key)column for this?
|
|
|
|
|
Each record is going to need it's own identity, yes, but it's useless in the row order because your users can rearrange the rows. You'd actually need BOTH colums, one for an ID key and the other for the row position in the view.
|
|
|
|
|
Thanks Dave
problem solved
|
|
|
|
|
|
You don't ask for much do you? We aren't here to write your code for you. We'll help you with specific problems but not the whole darn shootin match. That isn't the way that this site works - if that's what you want, try rentacoder.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
And the well-noticed pattern continues, Location: India...
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
The way you want do it involves writing your own network sniffer. Which, BTW, is a HORRIBLE way to do this.
Do it the write way and modify the database to log all this stuff. With Trigger support in the SQL Server, it's easy.
|
|
|
|
|
Can someone tell me what is the new Plugin API that comes with .Net 3.0 called? I want to use it but can find no reference to it.
Thanks
|
|
|
|
|
|
It's called System.AddIn and is in .NET 3.5, not 3.0. See these MSDN articles:/ravi
|
|
|
|
|
|
What is the difference between creating a static class object and creating a non static class object?
Class A{
Int a;
Public:
Fun1(){cout<<”hi”}
}
Static A obj;
Int main(){
A obj2;
}
What is the difference between obj and obj2? Does this make any difference if there is a static member within the class????
Thanks
|
|
|
|
|
A static member can be accessed with out creating the class. It would just be clasname.staticmember. If it is a non static member then you have to create the class to access the member.
Hope that helps.
Ben
|
|
|
|
|
kubben wrote: you have to create the class to access the member
Just to be pedantic: You have to create an instance of the class.
|
|
|
|
|
You are correct. Sorry if I wasn't clear.
Ben
|
|
|
|
|
Surely not - you only have to code the class to create it.
To make it clear to anybody else - I am joking.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thank you all for helping me out.
|
|
|
|
|
I am using a .net console apllication(C#) which makes API calls to a web service. There is a large amount of data transfer.
The exception i am getting is "The operation has timed out".
I generated stub classes from WDL files and using them in client application.
Where can i set the timeout value.
Is it on the client application or on the web server. and what parameters are used to set the time out value.
thanks
|
|
|
|
|
There are 2 types of timeouts that you can specify on the client side when making a call to a web service: send and receive. If you're expecting to send a large amount of data, increase the send timeout; if you're expecting to receive a large amount of data, increase the receive timeout. You can of course specify both or none.
The timeouts are properties of the binding. Here's an example of how to specify them.
string url = "http://localhost:1234/MyService";
EndpointAddress address = new EndpointAddress (url);
WSHttpBinding binding = new WSHttpBinding();
<code>binding.SendTimeout = ...;</code>
<code>binding.ReceiveTimeout = ...;</code>
ChannelFactory<IMyService> cf =
new ChannelFactory<IMyService>(binding, address);
IMyService svcProxy = cf.CreateChannel();
svcProxy.MyMethod();
Hope this helps!
/ravi
|
|
|
|