Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro 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 October 2nd, 2003, 09:18 AM
Authorized User
 
Join Date: Jun 2003
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default Monthview control and textboxes

Hello, I need help to solve this (for many of you it's simple I believe). I have 2 textboxes to fill with date information, and they use the same Monthview control. When i double-click in the monthview control it calls the CallByName function:
Code:
CallByName text1, "text", VbLet, DateClicked
The first argument of the function as to be an object (the name of the object on which the function will be executed). My problem is to pass the textbox that I'm using (if i'm using txtbox1 or txtbox2) to this function. Of course the easiest way to solve this is using another monthview, solution that I don't want.

Can anyone help me?

Thanks in advance,


Elisa Resina
__________________
Elisa Resina
 
Old October 2nd, 2003, 01:47 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Elisa,
why do you need CallByName? I would use a global variable:

Private m_myTextBox as TextBox

In your code, set this variable when you select your text box, like

set m_myTextBox = text1 (or text2)

and in date control event, just call

m_myTextBox.Text = DateCliked

Hope this help,
Marco
 
Old October 2nd, 2003, 04:01 PM
Authorized User
 
Join Date: Jun 2003
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a lot! It works fine and solved my problem.

Elisa Resina





Similar Threads
Thread Thread Starter Forum Replies Last Post
Monthview Control Problem krupalb Pro VB 6 0 September 4th, 2007 05:18 AM
Two TextBoxes hunzian78@yahoo.com ASP.NET 1.0 and 1.1 Basics 5 April 1st, 2006 06:32 AM
textboxes and additions toiletgraffiti C# 4 January 23rd, 2006 11:50 AM
Using Monthview with 2 textboxes eresina Beginning VB 6 0 October 2nd, 2003 08:33 AM





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