Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 12th, 2006, 01:38 PM
Authorized User
 
Join Date: Nov 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default sketching activex in MS Access

I'm trying to make an activex that will sketch lines based on dimensions entered in textboxes in access. My problem is that the activex flashes briefly what it is supposed to show, and then goes blank. I've removed all cls commands from the activex code, and from the access form, and it still does the same. What could be causing this to happen?
 
Old September 12th, 2006, 04:37 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

we need more information, like the way you paint the lines and where (usercontrol, picturebox etc)
 
Old September 12th, 2006, 07:05 PM
Authorized User
 
Join Date: Nov 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks,
  To illustrate my problem. I tried the most simple embodiment of my activex ever: it has a command button on it and a picture box on it. When you click the command button, it uses PSet to put a dot on the picture box. So the line is:
picture1.Pset(10,10)
   Unfortunately, while it works in a test Standard EXE within visual basic, it does nothing when located on an access form. Is there something I don't understand about the Line and Pset method, that they don't work outside of visual basic?

 
Old September 13th, 2006, 12:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Unless the PictureBox AutoRedraw property is set to true, you should use the graphics methods in the Refresh (or Paint, do not remember) event, because the drawing is not retained. For more info, look into MSDN for the AutoRedraw property.
 
Old September 15th, 2006, 11:13 AM
Authorized User
 
Join Date: Nov 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That solved it. Thanks!







Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Ms Access report to MS Word doc kite Access 1 October 22nd, 2007 01:45 AM
Database migration MS Access 2003 to MS SQL 2000 ayazhoda SQL Server 2000 3 April 23rd, 2007 11:38 AM
MS ACCESS 2003 FRONTEND AND MS SQL SERVER 2005 DB mohankumar0709 SQL Server 2005 3 March 23rd, 2007 12:48 AM
VBA cannot create MS Word Object- ActiveX Error Dolphin Access VBA 0 February 7th, 2005 01:03 AM
VC++ ActiveX Property Pages in MS Excel higgie Visual C++ 0 July 6th, 2004 09:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.