|
Like I said, the conversion isn't perfect.
About the error message - isn't there something weird about that?? Why would a Label control have a RecordSet property??? It won't. The problem is WAY beyond a simple explanation or a fix that can be easily explained in a forum. This is going to take a code review to get it fixed.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have a need to print a Form and its ComboBoxes and Labels by way of a ButtonClick. I found an example to use but it's very vague and I've been told that you can't code a Button in a Form to Print without an aftermarket tool.
Any advice?
Thanks
Jason
-- modified at 16:29 Wednesday 7th February, 2007
|
|
|
|
|
here is an easy way:
Dim bm As New Bitmap(Me.Width, Me.Height)
Dim g As Graphics = Graphics.FromImage(bm)
Me.DrawToBitmap(bm, New Rectangle(0, 0, Me.Width, Me.Height))
now you can customize this code to getting a bitmap that only contain client rectangle of your form.
another way is:
Public Class ScreenCapture
<System.Runtime.InteropServices.DllImport("user32.dll")> _
Private Shared Function GetDesktopWindow() As IntPtr
End Function
<System.Runtime.InteropServices.DllImport("user32.dll")> _
Private Shared Function GetWindowDC(ByVal hwnd As IntPtr) As IntPtr
End Function
<System.Runtime.InteropServices.DllImport("gdi32.dll")> _
Private Shared Function BitBlt(ByVal hDestDC As IntPtr, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As IntPtr, ByVal xSrc As Integer, ByVal ySrc As Integer, ByVal dwRop As System.Int32) As UInt64
End Function
'Save the screen capture into a jpg
Public Shared Function SaveScreen() As Bitmap
Dim myImage = New Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)
Dim gr1 As Graphics = Graphics.FromImage(myImage)
Dim dc1 As IntPtr = gr1.GetHdc()
Dim dc2 As IntPtr = ScreenCapture.GetWindowDC(ScreenCapture.GetDesktopWindow())
ScreenCapture.BitBlt(dc1, 0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, dc2, 0, 0, 13369376)
gr1.ReleaseHdc(dc1)
Return myImage
End Function 'SaveScreen
End Class 'NativeMethods
|
|
|
|
|
I tried both methods and the first one was promising, although nothing happened. The Second example gave me a bunch of errors.
I found a topic on this very same subject and ended up downloading a ToolPack to get the "PrintForm" component. I set the PrintAction property to PrintToPrinter and put PrintForm1.Print() in the event handler for the Button.
This got me the print!
Thanks for the help.
-- modified at 9:37 Thursday 8th February, 2007
|
|
|
|
|
Hi All,
I'vecome across a strange problem, Im trying to display specific fields (rows and items) in a database, but the db feedback the wrong fields.
My code is like this.
RichTextBox1.Text = dataSet.Tables("useCase").Rows(3).Item("EventID")
RichTextBox2.Text = dataSet.Tables("useCase").Rows(65).Item("EventID")
...etc
However this displays records from different rows, (but the item(eventID)stays the same)
Can anyone help in this matter?
Thanks in Advance
Jaidev
|
|
|
|
|
jady84 wrote: However this displays records from different rows, (but the item(eventID)stays the same)
Is the eventID unique? If not then there is the possibility that the data is genuinely the same.
Have you attempted to debug this and see that the data is really the same between row 3 and 65?
Have you checked the SQL is correct?
|
|
|
|
|
Colin Angus Mackay wrote: Is the eventID unique?
What do you mean by this? the EventID is not the primarykey, (in fact the table doesnt have one) but it is the only EventID field.
I have debugged it, and the data in rows 3 and 65 is not what shows on the form.
Checked the SQL a zillion times!
|
|
|
|
|
What are you using to display the data? A datagrid? try getting the data from the grid itself instead of the datarow...indexes in the grid may not be the same as indexes in the dataset because a grid can be sorted.
Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so
|
|
|
|
|
Hi EveryBody
Im using ASP.NET with VS 2005 and trying to make report with Microsoft Reporting Service. Those error Im getting is follows.
1.Report Viewer cant change the report. Example I got a TextBox under a Button where I can put a CustomerID in TextBox. I have put a CustomerID 1001 inside the TextBox and Clicked the Button, 1st Time Im getting the whole informations about that particular Customer. When I have changed the CustomerID like 1002 then !!! inside the code is working properly and the DataSet shows the information about that CustomerID 1002 but ReportViewer cant change the Customer Informations its remain same. Still its showing 1001 informations.
2.A data source instance has not been supplied for the data source 'DataSetAUDITLOG_CountLessons'. I have created 2 tables inside the DataSetAUDITLOG after that I have deleted CountLessons table from DataSET and Im not using this Table anymore and there is no relation with table anywhere. So why Im getting this error.
3. On the otherhand I want to send a CustomerID value to another page from a ReportViewer. Could you please tell me. How can I do it? If you have any project example about this please send me.
I need your help
Thanks
Sarfarj Ahmed
Sarfarj Ahmed
|
|
|
|
|
i want to split a string using split in vb.net.how i can use that
|
|
|
|
|
Dim MyArray() As String<br />
Dim MyString as string<br />
MyString = "Hello, World!"<br />
MyArray = MyString.Split(",")<br />
MsgBox(CStr(MyArray.GetValue(1)))
result would be "World!"
for example
My advice is free, and you may get what you paid for.
|
|
|
|
|
Johan Hakkesteegt wrote: MsgBox(CStr(MyArray.GetValue(1)))
or MsgBox(MyArray(0)) for Hello
or MsgBox(MyArray(1)) for World
or think... JOKE!!!
|
|
|
|
|
i want to draw one rectangle in windows form when i click a button.how can i do that.
anyone please help me
|
|
|
|
|
Create a Graphics Object from the window handle and then draw the rectangle using the graphics object.
eg.
Dim g As System.Drawing.Graphics
g = System.Drawing.Graphics.FromHwnd(Me.Handle)
g.DrawRectangle(System.Drawing.Pens.Black, New Rectangle(10, 10, 40, 40))
|
|
|
|
|
Hi,
I need source code for rental equipment, preferred in VB.
Thanks.
|
|
|
|
|
Please don't write everything in bold. The use of bold text is to emphasise certain words or phrases, if you use bold on all the text it has no meaning, it's just annoying.
You forgot to ask a question.
If you ment to ask for locations where you can find "source code for rental equipment", there are two obvious answers:
:: What is "rental equipment"? What do you need the source code to do? Should it "equip rentals"?
:: Have you tried searching for it using a search engine?
---
single minded; short sighted; long gone;
|
|
|
|
|
Hello everyone,i need source code of calender in VB.net.
|
|
|
|
|
Hiya,
Don't know if this would help, but I have found a good calendar at:
http://www.windowsforms.net/Default.aspx?tabindex=4&tabid=49
Scroll down to the User Interface section and there's an item called Outlook Calendar Look and Feel.
It is in C# though and NET 2.0, but might help you with some ideas. It replicates the Outlook calendar pretty well.
The control inherits from a DataGridView and basically just paints itself to look like a calendar.
I don't think I've ever found a full open source calendar written in VB.NET. There are a couple of pretty good third party controls that do calendars/schedules though.
|
|
|
|
|
what for? doesn't vb.net have it in toolbox so you can drag it on form?
|
|
|
|
|
we have an application that receives text that is not html document. we need to access this text from the code, but webbrowser1.documenttext is available only for html specified documents. how can we use the text from the webbrowser (it appears on the control, but we can only see it and not use it...)
|
|
|
|
|
Good question but i don't know answer. So you want your own html like reader? If you find it can u please mail me... I am interested in that too!!! Thanks.
|
|
|
|
|
hello
i have a map in autocade and object in this map (for example a Circle) has an ID
i want to import this map to VB.Net and access to objects and their IDs from VB.Net
thank you
---afsaneh_sheykhbahaei@yahoo.com
|
|
|
|
|
please don't crosspost. please !!!!!
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
you can use Autocad automation manual. if u has installed autocad find this file "acadauto.chm".
this book contain autocad object model and examples.
|
|
|
|
|
My dout is how to give Graphical look to a TabCotrol in vb.net,i want to give graphical look to the tab header and it's client area.
please any one know the solution then please help me.
Ram Krishna Pattnayak
Software Developer(SDS)
Sun-Dew Solutions Pvt.Ltd
www.sundewsolutions.com
kolkata
|
|
|
|