Please help.
I created a custom dialogbox name "DialogBox" . What i want is input values to the dialogbox, and those values appear on a textbox in Visio. After i creat the textbox and the dialogbox, I used "DialogBox.show ", so i can enter values, and I use "ashape as shape", "ashape.Text=us erinput", then how should i defind "userinput" ?
Thanks
9 3419
Please help.
I created a custom dialogbox name "DialogBox" . What i want is input values to the dialogbox, and those values appear on a textbox in Visio. After i creat the textbox and the dialogbox, I used "DialogBox.show ", so i can enter values, and I use "ashape as shape", "ashape.Text=us erinput", then how should i defind "userinput" ?
Can we clarify the programming environment in which you are working? Is this VB6? VB.Net? VBA or similar language built into Visio?
If VB6, I'd suggest that a textbox on the "dialogbox" window would be the way to go.
could you specify a little more.
I am using VB6. What i try to do is call the "dialogbox" in the textbox's code. Is there a function "ashape.Text=Di alogbox(xx)"? what should be the "xx" if i want all the input and label show up on the textbox.
Thanks
Can we clarify the programming environment in which you are working? Is this VB6? VB.Net? VBA or similar language built into Visio?
If VB6, I'd suggest that a textbox on the "dialogbox" window would be the way to go.
could you specify a little more.
I am using VB6. What i try to do is call the "dialogbox" in the textbox's code. Is there a function "ashape.Text=Di alogbox(xx)"? what should be the "xx" if i want all the input and label show up on the textbox.
From the sound of it, what you ought to do is write a Public Function which shows your dialogue box form (use vbModal on the Show), waits for it to be hidden (by the OK button or whatever on the form), reads the value of the text box on the form, then returns it as the value of the function. So, assuming you have created your form called DialogBox with a text box on it, you could do something like this in a code module... - ' On your DialogBox form, when the Ok or Cancel button is clicked,
-
' copy the button caption into the following global variable then
-
' hide the window.
-
Public ButtonClicked As String
-
-
Public Function UserResponse() As String
-
DialogBox.Show vbModal
-
' Note, because it's a "modal" window, control does not return
-
' here until it is hidden or closed.
-
If ButtonClicked = "Ok" then
-
UserResponse = DialogBox.Text1.Text
-
End If
-
End Function
Then in your code when you want to retrieve user input into your shape caption, just do something like... - aShape.Caption = UserResponse()
"aShape.Cap tion = UserResponse()" is what i try to figure out. It come out error message "Compile error: Expected array". Do i need to put something in ( )?
Thanks a again.
From the sound of it, what you ought to do is write a Public Function which shows your dialogue box form (use vbModal on the Show), waits for it to be hidden (by the OK button or whatever on the form), reads the value of the text box on the form, then returns it as the value of the function. So, assuming you have created your form called DialogBox with a text box on it, you could do something like this in a code module... - ' On your DialogBox form, when the Ok or Cancel button is clicked,
-
' copy the button caption into the following global variable then
-
' hide the window.
-
Public ButtonClicked As String
-
-
Public Function UserResponse() As String
-
DialogBox.Show vbModal
-
' Note, because it's a "modal" window, control does not return
-
' here until it is hidden or closed.
-
If ButtonClicked = "Ok" then
-
UserResponse = DialogBox.Text1.Text
-
End If
-
End Function
Then in your code when you want to retrieve user input into your shape caption, just do something like... - aShape.Caption = UserResponse()
"aShape.Cap tion = UserResponse()" is what i try to figure out. It come out error message "Compile error: Expected array". Do i need to put something in ( )?
You could try it without the parentheses. UserResponse() is the name of the function I described in my earlier message. For this to work it must be accessible. If it's in a code module (not a form) and defined as Public, this should work.
Unless aShape is an array perhaps - is this the case?
Oh! One other question. How come your shape control has a Caption property? Mine doesn't.
Oh, yeah, i am uing .text, not .caption.
one more question, can u tell me how to conbain "Sub... End Sub" and "Function.. .End Function"?
Thanks
You could try it without the parentheses. UserResponse() is the name of the function I described in my earlier message. For this to work it must be accessible. If it's in a code module (not a form) and defined as Public, this should work.
Unless aShape is an array perhaps - is this the case?
Oh! One other question. How come your shape control has a Caption property? Mine doesn't.
Oh, yeah, i am uing .text, not .caption.
one more question, can u tell me how to conbain "Sub... End Sub" and "Function.. .End Function"?
Sorry, I don't understand the question. Could you rephrase it?
Thanks, I got previous part work.
Can you help me on two other questions:
1) I show the custom dialogbox use the while loop, and there is a combobox in that dialogbox. I need use the last selected value in the drop down manu over and over again, but every time when loop back, the last selected value disppear. How to make the last selected value appear?
2) In that dialogbox have "OK" and "Cancle" bottom, I try use the follow code inside the while loop to stop showing the dialogbox, but it didn't work. Can you tell me how to defined the "cancel"?
"If Cancel = True Then
Unload DialogBox
End If"
thanks again.
Sorry, I don't understand the question. Could you rephrase it?
never mind, i got it.
Thanks, I got previous part work.
Can you help me on two other questions:
1) I show the custom dialogbox use the while loop, and there is a combobox in that dialogbox. I need use the last selected value in the drop down manu over and over again, but every time when loop back, the last selected value disppear. How to make the last selected value appear?
2) In that dialogbox have "OK" and "Cancle" bottom, I try use the follow code inside the while loop to stop showing the dialogbox, but it didn't work. Can you tell me how to defined the "cancel"?
"If Cancel = True Then
Unload DialogBox
End If"
thanks again.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: jj |
last post by:
Hi NG
I have a form, where I can activate the search and replace dialogbox when
pressing a button.
My problem is that the dialogbox opens with the default that it should
search for full match only, and I want it to open with default "a part of
field".
The VBA used is:
|
by: Shane |
last post by:
I am trying to create a custom command bar with three custom buttons,
however when I try to make the procedure there is no "CommandBar"
option to choose from and is not recognized for the following...
Dim NtsT1 As CommandBar
Dim NtsT1Btn1 As CommandBarButton
Dim NtsT1Btn2 As CommandBarButton
Dim NtsT1Btn3 As CommandBarButton
There is a CommandBarEvents and 2 CommandBarButton to select but no
|
by: Visual Systems AB \(Martin Arvidsson\) |
last post by:
Hi!
Is there a way to customize a dialogbox. I want buttons with the text:
Yes, No, Yes to all, No to all..
Also a dialogbox with a CheckBox.
Regards
Martin
|
by: foreman |
last post by:
Hello Everybody:
I am trying out DialogBox, and I have been trying to press the
OK Button on the dialogbox hoping I can receive the OK DialogResult
to Main Form. Below is my OK button click event handler code on
AboutBox Dialogbox:
DialogResult = DialogResult::OK;
It can also dismiss the dialogbox and return OK "Ideally".
|
by: majid |
last post by:
When i show a webform as a dialogbox using showModalDialog
script any postback event in dialogbox cause a new window
pops up .
How can i control the postback?
| |
by: Tim_k |
last post by:
Hi,
I'm using showModalDialog to open a Window and return a user selected
variable.
Here is the code:
retval=window.showModalDialog(sFrameName,window,sFeatures);
document.getElementById(sControlName).value=retval;
This works fine but I can't figure out to pass a value into the dialogbox
I'm creating. I display different data in the dialogbox based on this
variable. Anyone have a suggestion?
|
by: Fendi Baba |
last post by:
I am creating a simple project information database. In the project
information form 1 have two subforms. one contains organization
involved - many organzation can be involved - and another list of
people; they are from the organization choosen, To help me select the
people, I created a query to the "projectorganization", this narrowed
down the list to pple who belongs to the organization which are
involved in one project or the other. so...
|
by: PeteOlcott |
last post by:
Does anyone know how to make a scalable image on a DialogBox? I am
currently using a static Picture Control, can this be adapted to
become scalable to the size of the DialogBox?
|
by: duwei |
last post by:
I got a example, it GetBkColor from a HDC(the dc get from a DialogBox), but
it BkColor always color white, dialogbox default BkColor is color like gray,
how can I do to get the correct color for dialogbox? Thanks!
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |