Jump to content
Xtreme .Net Talk

shootsnlad

Avatar/Signature
  • Posts

    46
  • Joined

  • Last visited

Everything posted by shootsnlad

  1. thanks Just wanted to say "thanks" to Rosco. By combining what I had with using the Print Dialog box, I was able to get my printscreen to work as well. Thanks for the help...
  2. I have a create a printdocument object through the toolbox that is attached to the form. On some of the help examples it has some things like dimming a new PrintDocument. I don't have any option at all the dim a printdocument. Any other ideas? Thanks!
  3. no luck Still no luck. I'm using the drawimage method. Here is what the code now stands at: Public Class frmHydrantCard Private pimage As Image Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click Dim sk As SendKeys sk.Send("%{PRTSC}") Dim cdata As IDataObject = Clipboard.GetDataObject() pimage = cdata.GetData(DataFormats.Bitmap) PrintDocument1.Print() End Sub Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As PaintEventArgs) e.Graphics.DrawImage(pimage, 50, 50) End Sub End class It looks like the codes there.
  4. I don't understand. (?) I do get the data after I hit the print screen. As it sits now, the image is stored in 'pimage' and just needs to be printed.
  5. Getting Frustrated I'm really having some problems with this printing. I keep reading the same stuff on MS's website and in the VB .NET help, but none of it works, or I'm not understanding it right. I decided to post my code in hopes some humane soul quenches my frustration with some knowledge. Here it is: Public Class mainfrm Private pimage As Image Private Sub btnPrint_Click(ByVal sender As Object, ByVal e As EventArgs) Dim sk As SendKeys Dim cdata As IDataObject = Clipboard.GetDataObject() sk.Send("%{PRTSC}") pimage = cdata.GetData(DataFormats.Bitmap) End Sub End Class It's pretty simple really, I hit the Print Screen key for the user and snap the image from the Clipboard into a variable. I have display the variable in a picturebox and it shows the printscreen. It works pretty good. Now what do I add to print the pimage variable? Help! shootsnlad
  6. Well I basically have everything going except the actual printing itself. I can capture the image of the screen to an image variable. I have viewed it in a picturebox and have confirmed it to work. Now my problem is actually sending my image variable to the printer. I know I need to use a PrintDocument and I'm guessing I need to use the Graphics.DrawImage method, but I can not for the life of me figure it out. I have tried numerous ways, but I just can't get the right code, and as we all know, the help in VB .NET is worthless. Has anyone done a print of an image variable to the printer successfully? Thanks for the help!
  7. This reply is for CL or Thinker. I have most of this program converted to VB .NET. I am having some problems with a few things, however. The statements "hDC = GetDC(0)" has a problem and I also can't get the HDCToPicture function to work. Where do these statements/functions come from? They are unrecognizable in .NET. The only other problem I am having is figuring out how to actually print the picture. The Printer.PaintPicture is replaced with Graphics.DrawImage in .NET. Thanks for the help....
  8. I am attempting to put in a print screen option in my vb.net program. I did some reading in the help and it says that the PrintForm function is no longer in vb.net and it suggests using a third party program to do the same functionality. The problem is that multiple users will be using this program. I don't want to have to find some third party program and then install it on every PC that needs to run the prog. Is there anyway to do something similar to PrintForm in vb.net? or Does Windows come with something that I could use and automate this procedure without using a third party program? Thanks for the help! shootsnlad
  9. Actually it does not, the other ones do....
  10. I am using the data form wizard to create basically everything I want. I have done it with two tables and it worked fine. The third one that I generated a data form for, didn't generate a delete or update command in the data adapter. Any idea's why? I tried creating one manually, with no luck. I keep getting an erro r about a parameter not having a default value. Usually I believe the commands are generated automatically, but for this particular table, they are not. Any help is greatly appreciated, because I have no clue on this one! Thanks...
  11. fixed! I got it working. In my code, after I had found the datarow, I was recording the position of the dataset at that time, apparently the .position never changes even though I was moving through the dataset, so instead I recorded the for...next variable that I was using to find out what record I was on. I then assigned the current position to that, and it works just fine. Thanks for the help!
  12. best way Ok, now I'm not sure I'm using the best way to do what I want. I will provide an explanation and I was wondering if there may be a better tool to use to accomplish my task. Here is what I want to do: I have an Access Database that is linked to an Informix database. I have 3 tables that I want to interact with in that database. I want a form for each table. On each form would be various fields designated for each field in the database. I want the person to load a particular form, and then be able to navigate through the database. The user should be able to do things like: next, previous, first, last. I want buttons for Adding, Changing, Deleting and Finding a particular record. Here is what I have done: I used the data from wizard in .NET. It built me everything above, except for the find button. I currently am able to navigate through the database, as well as add, change, and delete a record. Any ideas? I appreciate the feedback. shootsnlad
  13. My problem is that I can not find the datarow in the dataset that I am looking for. For some reason, I can not retrieve the index of that row. I figured if I have the index from the row I retrieved, then I can do a dataset.table.position = ____ The buttons that I have for first,last,next,previous all use that position indicator to tell where in the dataset I am at. You would think that by doing a dataset.table.find and retrieving a row, you should be able to switch positions to the row you find. Boy, this .NET is tough to figure out. It sure doesn't help that the .NET help system is really bad too. Anyone have any idea? or atleast an idea of where I could go to get the answer?
  14. Well I was able to do a find on the primary key through the dataset, but it returns a datarow object. So I am able to find the row I want, but how do I tell the dataset to go to my datarow that I just found? Thanks!
  15. I used the data form wizard to create a form that a user can use to access an access database. I feel the need to have a 'find' button on the form. I have tried to look for the code to do it, but was unable to find anything. I have an object, a connection, and a data adapter. I thought that if I used the object, I would be able to do a search throughout the database. I was unable to find any function that would do it. I know that things like searching the database can be complicated, but I'm sure there is a way. I am doing a simple inputbox to get what the user needs to find, and then search a particular field in the database. Thanks for the help!
  16. What I am basically trying to do is to have an outside program call my program with an argument, telling my program which form to display. If the outside program calls my program with a "/HYDRANT" argument on it, then it should load the Hydrant Card form. The only way I could figure out how to do this would be to create a frmmain that: accepts the argument, hides itself and then shows the appropriate form. Since the outside program can't change which form starts up upon launch, I figured the only way would be to have a main form that steers it in the right direction. Thus, I can not use something like a button click event. I know this could be done back in VB 6.0, I just can't figure out how to do it now. Everything works fine with the arguments, I just can't get that frmmain to hide/close/become invisible. It's the only thing that is holding me back. Thanks for the continued help.
  17. I checked the name of the public class. It appears to me to be the same. Here is the exact coding I am using: Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim args As String args = command() If args = "/HYDRANT" Then Dim hc As New frmHydrantCard() hc.Show() frmMain.Hide() ElseIf args = "/VALVE" Then Dim vc As New frmValveCard() vc.Show() frmMain.Hide() ElseIf args = "/STOPBOX" Then Dim ts As New frmTapSlip() ts.Show() frmMain.Hide() End If End Sub Can you see anything wrong? I get that above error on all of the .hide lines. I did try to do the me.hide or the me.visible. The me.hide took, but it never hid the form when called upon. The me.visible would not compile. Any ideas?
  18. If I do a simple: frmmain.hide() I will get the following error on that line: I would've thought a simple .hide would've done it, but I always get that error when trying to compile.
  19. hiding a form I, for some reason, am having a very difficult time trying to hide a form. I have 3 forms, 1 of them is the main form. The main form is loaded at startup and then, depending on parameters will load one of the other two forms. The main form should then hide itself. I am able to open either of the two forms OK, but I can't hide my main form. The program won't run when compiled. It errors out on the line that tries to hide the main form. I am basically using this code to his it: dim mn as frmMain mn.hide() I am simply dimming it as a regular frmMain because it already exists. I didn't think I would want to dim it as a new frmMain, but I believe I have to dim a variable. Correct? Thanks for the help!
  20. I have some reports I created in an older version of Crystal Reports (v8.0). I want to be able to view them in my VB.NET application. I only have the standard edition of VB.NET, so I didn't get the new Crystal Reports package. My question is, how do I view these reports? The help talks about adding a CrystalReportViewer object to my form. I can't find that in my toolbox anywhere. Help! Thanks everyone! shootsnlad
  21. I just received my copy of VB .NET Standard edition. Does .NET have the data report designer like VB 6.0 does? I seem to remember being able to actually add a Data Report to the Project. I really liked that, being the designing of the report is so much like Access. Does VB .NET have this? Thanks for the help....
×
×
  • Create New...