|
Hi Nader,
I am working on your proposed solution. It seems I am getting somewhere with it.
When I want to draw the lines on the control I use the rectangle of the selected item on each list box for starting and ending points, but I think its giving me a hard time because the controls cordinates system is different than the parent form so let's say point1(120,43) is a completely different point on the user control.
Could you tell me how to map these two together, is there anyway to ask the user control to draw the lines based on the parent form cordinates??
Thanks,
|
|
|
|
|
Hello
There are two methods in the ListBox class inhertited from Control class:
PointToScreen() - Computes the location of the specified client point into screen coordinates
PointToClient() - Computes the location of the specified screen point into client coordinates
I suggest You follow these steps:
1- Use the ListBox.GetItemRectangle() to obtain item's coordinates
2- Transform it to screen location
3- Feed it to your CustomControl
4- Transform it to client location -this time it will be relative to the custom control
5- Draw you lines nice & easy
I hope it works fine for you
Regards
|
|
|
|
|
Well actually these two methods didn't work for me, I don't perhaps I couldn't implement it properly, but what I did I used TranslateTransform method to transform my coordinates to the upper left corner of my user control and it works properly now.
Thanks again dude,
|
|
|
|
|
I have one question how to make online chater in C# ???
thanks!!
nemanja
|
|
|
|
|
|
conemajstor wrote: I have one question how to make online chater in C# ???
That's like saying "I have one question...How does the US economy work?"
Ask specific questions if you want to get practical answers.
:josh:
My WPF Blog[^]
|
|
|
|
|
|
I'm trying to extend the bitmap or image classes. I've determined that the image class can only be extended by a member of it's own assembly. Now im struggling with the bitmap class being non inheritable. Does any one have any clever ideas about extending either of these two classes. Thanks
|
|
|
|
|
|
no it's not seald. But the Image class can only be extended by another member of the system.drawing assembly. grrr
|
|
|
|
|
|
I'd like to create a bitmap/image object that can scale and encode itself with internal methods.
|
|
|
|
|
You can't derive from Image because it lacks public Constructors. Only classes inside the same assembly can inherit from it.
The Bitmap class is tagged sealed , or NotInheritable (VB.NET), so you can't inherit from that either.
You'll have to construct your own class from scratch, or find a 3rd party library that does what you want.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
You could wrap it:
class MyBmp {
private Bitmap bmp = null;
public MyBitmap(...)
{
bmp = new Bitmap(...);
}
public Method1(...) {}
public Method2(...) {}
}
You need to rewrite all methods and constructors you want/need and internally operate on your Bitmap object. It's a bit of work, but it should do the job.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
thats great advice. I'll try that and let you know how it turned out
|
|
|
|
|
hi,
i have a property grid control... can u plz guide me how to display a set of values in a drop down form in the property grid control. i am using c# windows application.
-- modified at 12:04 Monday 3rd July, 2006
|
|
|
|
|
TypeConverter.GetSupportedProperties()
|
|
|
|
|
I need to be able to grab files from an Windows print queue before they print so I can parse them and perform some data extraction (for a client). I was thinking of writing a small piece of code that constantly checks the print queue folder in windows for new files, however from my understanding the files in there are temporary and slowly go down to zero bytes as windows streams the data to the printer for printing. . Is there anyway i can pause the print queue or make the files stay persistant in there for a timeperiod long enough for me to be able to copy them regularly ?
My other option i suppose would be to make a printer driver that captures the files and parses them, but thats gonna be much more complicated and not something i really know how to do.
Thanks for the input
|
|
|
|
|
I hope that all your doing is parsing a straight text file. If not, you'll find this to be very nearly impossible to do.
Your other problem is parsing the files in the print queue. Since various print drivers and setups can generate different language for those files, you'll have to write parsers for them to get the data you want. You'll have to identify whats in the file first, then call an appropriate parser, that you have to write.
For example...A dot-matrix printer can handle wither straight ASCII text to print a page, or it can handle the page sent as an image. This would be thousands upon thousand of pieces of data describing the image. You'll have to use some kind of OCR algorithm on the page to get the data you want.
Now, laser printers can complicate the thing even more using various print processors and dataformats, like RAW, Postscript, PCL, EMF, ... Are you going to write parsers for each of these formats??? I doubt it...
Basically, what you want to do just isn't practical. There has to be an exasier way to get the data you want without jumping into this monstrosity...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have written an app that takes user input from a richtextbox and stores it in a database. So far, everything is working great, with one exception. i can copy and paste an image into the box, but once it is saved, the image is gone. Now, i have looked at the rtf markup that is generated, and it seems to have the opening and closing tags for the image, but it does not appear to switch the image over to base 64 encoding, which is how they appear to be saved when using Wordpad.
is there a setting for the richtextbox control to capture an image as part of the document?
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
Now i am doing projects in VS 2005.(Windows application).
I have datagridview in my application,that contain one checkbox column and some data coloumns.
Now i check few rows in check box coloumn.Then when i click any other coloumn header,all rows are automatically sorted,and all rows in check box coloumn are unchecked.But i want to retain the selected values after sorting is done.
for example,
In datagrid I have two column.
Column name Type
Select -- checkbox column
Store ID-- integer valus
Now i select few rows in checkbox.then I click StoreID column header.
now the rows are sorted based on store Id and all rows are unchecked.but i want to maintain the checked status of stores to true, which is selected by me before it is sorted.
can u give any solution for my problem.
|
|
|
|
|
i am working on c# & asp.net platform
As we see in sites when we open aspecific site automatically someother advertisement page popsup.
The same functionality i want to use in the following scenarios:
1.when a user clicks on a button (which is used to display a calender),so the calender should pop-up within that page.
2.similarly i must be able to popup any other page
Also helpin this scenario:
suppose there is page called index.aspx,which has 3 links.
when a user clicks in each of the three links three windowspopsup,but once the user closes the index.aspx page all the popupwindows must automatically get closed.
pl kindly helpme
arun
-- modified at 11:09 Monday 3rd July, 2006
|
|
|
|
|
If you wan the popup windows to close along side the parent page it sounds as though you may want DHTML windows. Here is a great tutorial of various types of DHTML windows: http://www.brainjar.com/dhtml/drag/
In order to invoke the windows you can make the links .NET linkbutton controls. linkbuttons have a property named OnClientClick that accepts a string of client side code that runs when the user clicks on the linkbutton.
e.g. <asp:linkbutton onclientclick="window.Open();" ;="" runat="server">. I hope this helps.
|
|
|
|
|
I am working on a project
i have created 3 tiers:
presentation layer
datalinklayer
business logiclayer
i have a dropdownlist named Category_List resides in my login screen.I want to dynamically add the items to it .so i created a table called type which has a single field called Category.
now i want to bind my backend sql server with my application.
i am able to do it staight away in my asp.net application but what i want is that the connection string should be in a class file ,while the page loads the method that contains the connection string should be called and the items must get filled in my Dropdownlist.
iam unable to do it inthe class file,pl help me in doing so with helpof an example.
thank u
arun
|
|
|
|
|
Hi, I am currently making a application that converts different audio files. I am having trouble converting MP3 to WAV though. Can anyone please help me? Thanks.
Hengy
I like Pie
|
|
|
|