|
if you swap this line
g.DrawRectangle(myPen, startX, StartY, Math.Abs(startX - e.X), Math.Abs(StartY - e.Y))
with
If e.X < startX And e.Y < StartY Then
g.DrawRectangle(myPen, e.X, e.Y, Math.Abs(startX - e.X), Math.Abs(StartY - e.Y))
ElseIf e.X > startX And e.Y < StartY Then
g.DrawRectangle(myPen, startX, e.Y, Math.Abs(e.X - startX), Math.Abs(e.Y - StartY))
ElseIf e.X < startX And e.Y > StartY Then
g.DrawRectangle(myPen, e.X, StartY, Math.Abs(e.X - startX), Math.Abs(e.Y - StartY))
Else
g.DrawRectangle(myPen, startX, StartY, Math.Abs(startX - e.X), Math.Abs(StartY - e.Y))
End If
then you can draw the rectangle in any direction
"If i was king cigarettes would be free."
-- modified at 10:43 Thursday 23rd March, 2006
|
|
|
|
|
Thanks so much guys - that was exactly what I wanted!! I did get started with code very similiar but couldn't work out how to not draw every rectangle (instead of the just the current one) and also hadn't got it to work from any direction so I'm grateful for both tips.
Cheers,
Mike
|
|
|
|
|
How am i to display an image in a gatagrid from the SQL Server where the image is stored in the IMAGE field as byte()... I've found the way to convert it back to image form but how am i to dsplay it in the last column...
|
|
|
|
|
|
Thank you for the link sir but i donot want a querystring to be passed neither do want a reference pointer to the image i am using
"select * from tablename"
and want to convert the byte array to image at the 4th column in the table and insert the image to the same column but the conversion is done to a System.Drawing.Bitmap and not being displayed in the grid...
|
|
|
|
|
in vb 6 there is a mschart object
but in .net cant seem to find one
where do i start to be able to create a chart
ty in advance
maytel
|
|
|
|
|
Search it in the COM component section
Right click the tool box
Select Add/Remove components.
Select the COM components tab
Chatura from Pearl of the Indian Ocean.
|
|
|
|
|
|
ill look into it tnx
-- modified at 1:38 Thursday 23rd March, 2006
|
|
|
|
|
Here's another free .NET chart control. The charts look great, comes with plenty of examples, it's very stable, and development/support is active.
I highly recommend it.
http://zedgraph.org[^]
|
|
|
|
|
Hi!
in my below code how can i instantiate webchart webcontrol so that i get each dataview binded to seperate webchart.
say webchart1 will hold one dataview, webchart2 will hold another dataview and so on...
currently i only have datagrid1 webcontrol(eventually that datagrid will be replaced by some charting tool) which only picks the last dataview in loop. i actually would like to pick each chunk of data and populate seperate web chart.
for eg.
-----------------------
objConn = New SqlConnection(dbPath)
Try
'select the table with only distinct ID based
cmd = New SqlCommand("select distinct measure_id from measuredata m, textdata t where t.ScoreCardId = m.ScoreCardId", objConn)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim dtId As New DataTable("MeasureId")
da.Fill(dtId)
'select all columns with ID
Dim cmd1 As SqlCommand = New SqlCommand("select * from measureData", objConn)
Dim da1 As SqlDataAdapter = New SqlDataAdapter(cmd1)
Dim dt As New DataTable("MeasureSource")
da1.Fill(dt)
Dim myView As New DataView(dt)
Dim datarow As DataRow
For Each datarow In dtId.Rows
myView.RowFilter = String.Format("Measure_Id='{0}'", datarow.Item("measure_Id"))
'######## checking if the dataview works #########
MycosChartWeb1.DataSource = myView
MycosChartWeb1.DataBind()
Next datarow
Catch ex As Exception
Response.Write("OOPs what went wrong:" + ex.ToString)
Finally
End Try
------------------------------
hope my question makes sense for what i wanna achieve.
please help thanks
robin
|
|
|
|
|
Hi,
I have an aspx file to generate a report for user. Users can print this report out from browser. But I found that there are page number, date and url on each page's header and footer. There's no way to remove these information except ActiveX. I cannot use ActiveX because activex requires user to enable it which is annoying.
So I'm wondering if I can convert my existing aspx file into PDF and display this PDF file in brower. I did a lot of search, all I can get is how to convert a HTML file into PDF, which wont work in my case.
Can anybody help me here?
|
|
|
|
|
An aspx file is not able to be viewed until it is a html file. So, the answer is no.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thank you for your reply. But html cannot generate report dynamically.
All I need is to generate a dynamic report in an aspx file that user can print it out without page header and footer.
Any idea?
-- modified at 18:06 Wednesday 22nd March, 2006
|
|
|
|
|
Your report should be generated by your middle tier anyhow. Return it as a bitmap and turn that into a pdf.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Could you give me some more details?
My report has many pages, I generated each page in one user control, then insert these user controls into an aspx file. When user open this page, he will see a whole report.
Actually, we can just say that I have a web page writen by vb.net, how can I convert this page into pdf.
Thanks.
|
|
|
|
|
Your report is just a datagrid ? OK, I was thinking of graphs and stuff.
Basically, you need a middle step that creates your report as text or a bitmap, then you have something you can turn into a pdf. Your core problem is that you start with a system that's been written to render the report as HTML, on the client machine, but you need to write a means of rendering it on the server, so you can turn it into a PDF. In other words, you're asking for two steps, parse the aspx, and create a pdf. You're not going to find a product that does both for you in one step.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
The report is not a datagrid. there are graphs and other stuff. I guess I have to give up these aspx files and start from PDF generation.
Your reply is very clear. Thank you for your help!!
|
|
|
|
|
|
Or you can generate the HTML and not send it to the browser but save it on the server. Generate PDF from there (as you said you can) and then send the PDF to the user...
--------------------------------------------------------
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Thanks, I has looked into this before. But it seems like for static contents only.
I dont know how to use it for my dynamic aspx file.
|
|
|
|
|
hi everyone..
i have have form.. e.g a form1 and i want to load it in the project window at run time.. i dnt want to pass through the GUi interface.. can i acces the project window dynamically..
plz help Me
Arshaad
|
|
|
|
|
Is there a Bluetooth API for VB.net? and where can I find it
thanks
|
|
|
|
|
|
I have a drive called U:
In the U: drive i have a test folder that has may .tif files. Inside the
test folder i also have a PreRev folder.
The test folder has many .tif files that do have the same last 10 bits.
What i am trying to do is to loop through the test folder and see the files
that have the same last bits.
If i find two or more files that have the same last 10 bits, i would like to
send a copy of that same .tif file in the PreRev Folder.
This PreRev folder is going to be the clean folder that wont have any file
that share the same last 10 bits with any other file in this folder.
So fare i have created a simple user interface that has 2 buttons and a
text box. The one button is called "Choose File" and allows me to pick
any file in the test folder. The other button is called "Eliminate Dups"
and will be used to eliminate the duplicates.
I can so fare click on the "Choose File" button and browse to the directory that has the file that i want to open.
Also when i select the file its name shows up on the text box fine.
What i want now is a code that allows me to click on "Eliminate Dups"
and test if that selected file has any other file within the test folder
that has the same last 10 bits. If this is true i want to move a copy of that file
in the PreRev folder; if not display a message saying no duplicates.
Thank you in advance
|
|
|
|