Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Problem With Popmenu In Textbox


I need to create a popup menu for the text box, that is when you right click the textbox, submenus created from the menu editor should appear. the problem is when I right click the textbox the first popup menu that appears is that which has copy, paste,....select all, and not the one that I created. It only appears after I right-click again for the second time.

please help




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Add Items To A Textbox Popmenu
Hi all,

please see this picture and tell me if its possible to add items to a textbox popmenu without having to make a new one sensitive to the mousedown event...

Thx in advance...

PopMenu
Hi...
in my project i have a function (translate()) it can translate a words frome notepade file to other notepade file, then i want to take the words in the second notepade to replace it with the words in popmenu.
(The popmenu appear when we click right click on the word we have it in RichTextBox)

please, help me if any body have an idea?

PopMenu Skinning
Hello !
Please help If you know:
I want to (1) put a bitmap (! not a brush) in the background of a popupmenu (that is raised from menu bar) and (2) set the border of this popupmenu to be flat. Now I can to put a bitmap on the all menuitems of this popupmenu, set them edges to flat, but isn't enough. I used for this vbaccelerator exemple but there I have only menu items.
I have the handle of the popupmenu but when I'm trying to get the rectangle of it all 4 dimensions are 0:

I used:


Code:
GetWindowRect hMenu, tR
to get the rect of popupmenu but tR.Left = 0, tR.Right = 0, tR.Top = 0 and tR.Bottom = 0.
I want to use DrawEdge api to set the border of this popupmenu but I need the tR dimensions (for 2# question).
I want to use BitBlt or StretchBlt for this handle but, the same, I need tR dimensions (for 1# question). What I am wrong ?
All examples (I could found 'elitevb', 'vbaccelerator' ) deals only with DrawMenuItem, not with the parent popupmenu.
Any other exemples or suggestions ?
Thank you !

Popmenu With Mdiform
hi
i m developing application where it has mdi forms and menus in it.
i m having child forms in it. in the child form, i m writing a pop up menu where it shows list of options like cut,paste etc. i had made the menu invisible and on right click of the form, the popup menu appears, but my menus in MDI forms gets invisible. If i set my mdi child form to false, then the mdi form menu appears. but i need the child form to be mdi child.
i have tried various options, but i couldn't


how to make mdimenu visible.

please help

Add Popmenu Code
Add popmenu code ...?

Add Item To IE Menu (Popmenu)
How can I add an Item to IE's right click menu...

Essentially heres what I want to do...

Wife finds a recipie on a certain site...
right click...."Add to Recipies"

then in the code...I want to strip out the good stuff and Insert it into a database.

Anyone?

Much Thanks!

Popmenu In Systray Crashing!
In the systray I have a PopMenu.
When the user right clicks on the icon, a menu appears.

The problem is, that sometimes the icon disappears from the systray. Why, I don't know. The user has to log off and log on in windows to get the icon back in the systray.

Is there some way to determine that the programm crashes and then restart it automatically with, for example, the shell command?

The OS platform is NT and the VB version 6.0 SP5.

PopMenu-change The Caption
At first, I fill the PopMenu with the method Additem. For example
Popmenu.additem “Test”
My Problem is in the event SWBPopMenu1_Click, where I want to change the string “test” and have(replace with) an another one for instance “Test Exams”(that depends on where the user click).

Urgent - PopMenu Failed!!!!
I have a form in which I have displayed many shape controls ( All the Shape Controls are in a single control array ). When I right-click on a Shape Control I display a PopupMenu . It works.

But when I go to another Shape Control and Right-click nothing happens. The previous Pop-Menu remains. I am not able to trap any events. Only if I click the Form with Left-Mouse Button, the Pop-Menu disappears.


How do I display the PopUpMenu at each and every click ?


Thanks in Advance

Anand

How To Reveal Line Break For Perticuler Textbox In External Richtextbox/textbox?
Hi all could any one show me a method to identify the line break for perticuler richtextbox/textbox in external richtextbox/text. I am looking for things like this :<pbr>

I know all richtextbox/textboxes does not support that and some have thier own line break. could any one show me how to obtain that line break .thanks



class name info of rich edit :

RichEdit20A
#32770
AtlAxWin71
ATL:0053D798
WTL_SplitterWindow
WTL_SplitterWindow
WTL_SplitterWindow
My Window Class

Draw Textbox, Format Border And Type Text Into Textbox In A .doc File
I use this codes to open a .doc file and draw a textbox in it. What should I add to input text into the textbox (I used Selection.Text = "......." but the text are outside the textbox) and format it's borders?
[font=courier new][color=darkblue]
Private Sub Command1_Click()
Dim objWord As New Word.Application
Dim objDoc As Word.Document

objWord.DisplayAlerts = wdAlertsNone
Set objDoc = objWord.Documents.Add

objDoc.Shapes.AddTextbox msoTextOrientationHorizontal, 100, 100, 100, 300

objDoc.SaveAs "C:WINDOWSDesktoplabel.doc", wdFormatDocument
objWord.Quit

cmdEnd.SetFocus

TextBox – How To Invoke ‘Command_Click()’ Upon Carriage Return Press In TextBox
Hi All,

I have a TextBox which I use to enter a serial number and a Command Button to execute a query to a database that takes the value entered in the TextBox.

How do I simulate the ‘Command_Click’ event upon Carriage Return press in the TextBox after entering the serial number? (saves the user having to press the command button using mouse)

Thanks in advance, Ash

Text Dissapears Form Textbox When I Tab Or Click Into Another Textbox
The title says it all really.

I enter text into txtName and then I want to enter text into txtInitial so I either tab to it or click into it and when I do the entry in txtName just dissapears.!!!???!!

I am setting textbox proerties at runtime...

Code:
With txtAddMemName
.Text = ""
.TabIndex = 0
End With
Make sure the textbox is empty....Text = ""
Set the TabIndex....TabIndex = 0 ....and so on
I have all the textbox properties in Private Sub TextBoxProperties() so that the form load section is easier to read.

Is that not right?

Retreiving The Pixel Contents Of A TextBox When Textbox Is Not Visible?
Is that possible? I need to get the contents of a textbox using StretchBlt, but this only works when the TextBox is visibly on screen, other wise I just get the contents of the screen where the textbox would be shown. How can I do this?

Passing Array Value In Textbox. The Textbox Turns Up Empty.
I am passing the value of an array to a textbox, but it always turns up empty. When i pass the same value to an excel cell, i get the value. The function calculates the value of USCityA

I am giving parts of the code below:
Redim Pline(9)
Pline(9) = USCityA
test = "Hello"
USA = test & Pline(9)

In another sub, i call this funtion above to allocate the value of USC to the city as shown below:

CityA = USA

Activesheet.OLEobjects("txtbCityA").Object.Value = "CityA:" & CityA


The value i get in my textbox is only "Hello". When i pass USA to an excel cell, i get "Hello Fortworth" (or whatever the value of "USA" is calculated in the function)

Textbox Ctl Right Justify Sends Text Too Far Out The The Textbox [SOLVED]
I have a newly made textbox control by Thief_ that I've modified and it works fine if Alignment is set to 0 - Left, but if set to 1 - Right Justify I have to type in several numbers before they start to appear from the right. How can I fix this? What property do I have to change / include in the control to control where the string begins when set to right justify?


Thanks

_________________________________________________________________

Edited by - vbprog1144 on 5/30/2005 5:33:50 PM

Background Image In My Textbox Or Rich Textbox
I need to place a background image in a textbox or rich textbox as well. Is there no API or GDI(?) solution?

Background Image In My Textbox Or Rich Textbox
i would like to place a fixed background image in my textbox or rich textbox so it will act like a watermark. is that possible? please help.

i tried to use an rtf file template with image on it but everytime the rich textbox is updated the image is removed from view. i would like to remain on its position.

thank you very much. :P

Add Colored Text To Textbox Or Rich Textbox
Is there is script to make it add in a textbox the same text that is in the same text box plus some other colored text. eg

Before:

Code:
text

RichTextBox1.Text = RichTextBox1.Text + textFormated(&Hff,"lol")
After:

Code:
textlol

RichTextBox1.Text = RichTextBox1.Text + textFormated(&Hff0000," test")
After:

Code:
textlol test

Textbox Compare With Textbox Delimited Per Line
First of all, i loaded a txt file into a txtbox1 - numbers delimited by blanks in rows. There is another one txtbox2 whithin i type some numbers delimited by commas. I want to compare the numbers in txtbox2 with the numbers in txtbox1- line by line and get the common ones per line.
-whats the code for searching the txtbox1... line by line?
-whats the code for comparing (find commons) the values in txtbox2 with the ones in txtbox1 per line?
controls: commonDialog,2 txtboxes,cmdbutton,label that shows the commons
OR suggesting to read the txt file and seek the commons inside it while counting them by line?
See some code:
Open fileLoaded For Input As #1
txtContents.Text = Input(LOF(1), 1) ' i load the file into the txtbox by line

Do While Not EOF(1) ' Loop until end of file.
Line Input #1, numLine 'assign line of txt file into the var numLine

....????
thanks

In Vb.net From 1 Textbox To Another Textbox Moving By Pressing Enter
as in vb6.0 we r write code in textbox keypress event as follow to move from textbox1 to textbox2.

if keyascii = 13 then
    textbox2.setfocus
endif

so above same task i want to do in VB.net
Please help me to solve it

Thank you

How Can I Selct All The Text In Textbox After I Click The Textbox?
How can I selct the whole text in textbox after I click the textbox? Thanks!

Sub Asks For Textbox Sub Can't Handle Textbox
The following sub worked just as I wanted when it was called

Code:
UpdateCPE
The code for the sub is shown here

Code:
Private Sub UpdateCPE()
On Error GoTo FormCurrentErrorHandler
Text44 = CPE(sizeShift1, Combo14, Text46)
Exit Sub
FormCurrentErrorHandler:
Text44 = ""
Resume Next
End Sub

Yet this sub is giving me the following error.
Runtime error '424': Object Required


Code:
UpdateCPE (Text44)

Here is the code for this sub

Code:
Private Sub UpdateCPE(tBox As TextBox)
On Error GoTo FormCurrentErrorHandler
tBox = CPE(sizeShift1, Combo14, Text46)
Exit Sub
FormCurrentErrorHandler:
tBox = ""
Resume Next
End Sub

What gives? I passed plenty of textboxes to functions that I've written. Why is there a problem when trying to pass a textbox to the sub?

Press {TAB} To Jump From 1 Textbox To Another Textbox
dear,

i have a problem here,
hope someone out there may help me 2 solve it.

i'm doing a proposal now,
almost complete,
but left one thing...

i hav a page that looks like a registration form,
it has a lot of textboxes to let user to enter their data,
now the problem is..
i donno how to use "TAB" on the keyboard to jump from one textbox to another...
that's mean...when i press "TAB" on the keyboard,it will allow me to continue type my infor in the next textbox..

yo help is much appreaciated..
thank u

ID An Individual Textbox In A Textbox Array
Hi to all!

Can anybody tell me what is the correct syntax to use when identifying an individual textbox in a textbox array.

The number of textBoxes differ all the time and does not have a fixed number of textboxes.

I need to print these textbox values but do not know how to identify them.

I have got this far: :-(

Dim i As Integer

For i = Text3.LBound To Text3.UBound

(I would like to ID the textboxes between these values)

GLEN

Placin # In Textbox Then Adding In Another Textbox
i am building a calculator and i need help with some stuff.
I want my program to display every key i hit on it (1,2,3,+,-,/,*,=) in textbox1, and then giving me the ANSWER ONLY in textbox2. Can anyone help me?

Pressing Enter To Go From Textbox To Another Textbox.
I have this code but it is not working, is there a form or text box property that needs to be set? Thanks...

Code:
Private Sub TextCustomerName_KeyPress(KeyAscii As Integer)

If vbKeyReturn = KeyAscii Then
r = Set_Focus(TextProduct)
End If

End Sub

Keeping Formatting From Textbox To Textbox
Ive had a few ideas so far, none of which have seemed to work

Im trying to get one rtb boxs text into another using the same formatting. From the insertion point.

it works however when the code is repeated again the text becomes reformatted by default. I was wondering whether was a property in the rich text box that allows lots of colours in the text. or some code that could do this for me.

I was thinking of a way by maybe using the clipboard and the sendmessage API to do this. Could i do that?

thankx in Advance

neutrinohunter

Change Focus From Textbox To Textbox
Hello Evryone:

I would like to know how to change the focus between textboxs using the "ENTER" key instead of using the tab key. Right now the tab key is moving between the boxes but not the enter key?

Any Ideas?

Thanks
Art W

Using One TextBox To Display Information In Another TextBox
My question is how do you use another textbox to display data

after you have got the input from the user using a textbox, i.e., in

a similar manner to a listbox displaying all pieces of data that

have been entered, for example a batch of exam marks. I know

it involves the newline character but can I get it to

work!!

Resize Textbox And Picture On A Textbox
can anyone tell me how to maximised the textbox when the form or vb program is maximised? also how to put a pictrue on the background of a textbox?

Copy First 5 Words Of Textbox Into Another Textbox
Hi

I need help again. I am trying to get the code to be able to read the first 5 words from a text box and copy them into another textbox.

Please help

Cheers

Simon

Textbox = Textbox Wont Work
I used to be able to do this but now I cant. My sister asked a similer question but diffrent. I have a form (from1) and another form (form2) I have a textbox in each (text1). And a command button in form1 (command1) When u press command1 I want all that text to be transfered to form2.text1.text But my code:
Code:
form2.text1.text = form1.text1.text

And I dont know why! It used to work but It doesn't anymore.

History - A thing of the past
Those who dont know the past are bound to repeat it.
Veni, Vidi, Vici - Julius Caesar

TextBox Field In Form1 Should Automatically Show Up In TextBox Field In Form2
I have budgeting problem where I want the Calculated Total Income Amount TextBox Field to appear and be the same Total Income Amount in Form2. When there are changes in the Total Income Amount in Form1 these same changes should appear in the Total Income Amount in Form2. Is there a way to link these two fields. Me.Form1 and Me.Form2 and so on.

I have always linked cells in Excel for Row1 in one worksheet with Row1 in another sheet. The same principle.

Thanks for any help

jjc9809

Put Name Of TextBox In Textbox (Word-VBA)
I have a Word document with way too many textboxes, some of which refer to each other (it's an automated test procedure document). I'd probably find a different way to organize it if I had it to do over, but it's (mostly) pretty simple.

However - for documentary purposes, i'd like to be able to generate a copy of the document with the name of the textbox visible in each textbox.

something like: (EXAMPLE of what I want follows - I know this won't work...)


Code:
For Each TextBox in ThisDocument
TextBox.Text = TextBox.Name
Next TextBox
For that matter, I'd like a similar function that can set them all to nothing ("") so that the form can be easily cleaared for another run

Am I stuck with having a BIG function that clears (or sets...) each individual textbox by name?

(I did search for this topic first but didn't find it - if it's been asked & answered before, you're welcome to post a link to the thread and I'll go read it.)

Thanks in advance

---rkh in SEPA

Textbox.Value Vs. Textbox.Text
For a textbox, what's the difference between its Value property and its Text property? When do I use:

txtTextBoxName.Value

and when do I use:

txtTextBoxName.Text

Thanks!

-- Tom

Sorting Textbox Into Textbox
I have a application in it there are two forms. Form1 has 5 buttons and a scroll. When you click the buttons they add at runtime testboxes right next to each other making lines from them. You can add any information in them. This is true for setup button, equipment button, note button and header is just a title so this would go on top of a equipment button because it describes what is each textbox. Of course the delete button is for each of them and it only deletes it. I also have a preview button on the bottom of the form. When clicked it is suppose to move all the information from the scroll in form1 to the form2 where another textbox serves as a display for a preview of what the user has added in form1. *note: the order of lines added in form1 is up to the user, he or she can add a setup line follwed by a equipment , then another setup etc... the combination is unlimited but its up to the user.

The problem:

when you add setup line by clicking the setup button, then you add three lines of equipment with the equipment button, and then you add another setup button by clicking the setup button. Add text to each textbos and finally click preview.

The problem, the application does not hold the order of the lines added by the user. So if you added the ines how i said before and tried to view the information in that same order you will see that in the form2 the preview textbox everything has cchanged in order and somethings are mixed. I need a solution for it to keep the order the user adds, it can vary so i guess it needs to be smart code or something i dont know. I have asked many times and nothing no one seems to know how. Thanks for you help/

Copy Textbox To Textbox
I read the rules and it said not to post to old threads but I have this same problem and this will not work for me cause it needs to copy from text1.text
to text2.text but it needs to do this more then one time so like this
text2.text = something like 1234567891093876283710
if I do
Code:
text1.text = text2.text
then it just changes my text1.text and makes it the same as text2
but I want it to copy text2 and leave what is in text1 so it would come out to this
text1.text would have now 2 in it something like
1234567891093876283710
9876543211230909871275
and would keep copying it so I can fill up text box
how would I do that then when I get all the numbers
I want in text1.text how would I save it to notepad??
thank you

Copy Textbox To Textbox
Im sorry guys but is now two years ago i used vb for the last time.

but please help.
For the local sport team i need to make tournament form.
It is a knock out form like this.

16 teams, playing against eachother. there will be 8 winners after that 4 winners and so on.

I made 16 textboxes and then 8 textboxes and so on.
I thought to simple and made a button like this

Private sub command_click()
text1.text = copy
text2.text = paste
End sub

but it wont work.
after i press the button both text boxes are empty.

What is the answer to copy text boxes.

Yours,
mark

Textbox To Textbox Question
Hey guys, havent been around for a while. Attempting to do something and having some probs. Attempted to search before posting and couldnt find what I was looking for, sure its been discussed before though.

This is the senario

Have a form with an input field. The form is called frmSignIn and the textbox is called txtSignInScreenUsernameInput. Have another form called frmAddEntry with a textbox called txtAddEntryUsername.

What I am looking to do is when someone enters in a username into frmSignIn.txtSignInScreenUsernameInput and sign into the program, the value in the frmSignIn.txtSignInScreenUsernameInput is automatically added to frmAddEntry.txtAddEntryUsername. For some reason, I am not able to get it to work. This is what I have tried, I am sure my thinking is logical.


VB Code:
Private Sub Form_Load()frmSignIn.txtSignInScreenUsernameInput.Text = frmAddEntry.txtAddEntryUsername.TextEnd Sub


I also tried switching it around and that didn't do anythin either. The text box on frmAddEntry is always blank.

Please advise if you can. I am sure this is easy stuff.
Thanks.

Convert Textbox To Textbox
So in text1 I will have things like {-}. And when I push a button I want it to goto text2 and have that change to a. So like {-} = a {--} = b {---} = c and so on and i want it to convert it when i push a button. I tried it a few different ways but the best i can get is to convert a alphabet once . Anyone kno how to do it?

Passing A Textbox Value To Another Textbox...
Ive created a login form (with textbox and command click button) for my program. When the program launches the Login form appears. By default I have set the login to syslock. Once the user logs in he/she will then have an opportunity to change the password via a second form (with textbox and command click button). I need to figure out how to propagate the value of Text1.Text over to txtPassword.Text which will then replace syslock with the new password.

Here's the code for the command click button on the first form (which works fine).

'ToDo: create test for correct password
'check for correct password
If txtPassword.Text = "syslock" Then
OK = True
txtPassword.Text = ""
FrmOptions.Show
Form1.Hide
Form2.Hide
Me.Hide

Else
MsgBox "Invalid Password, try again!", , "Login"
txtPassword.SetFocus
txtPassword.SelStart = 0
txtPassword.SelLength = Len(txtPassword.Text)
End If


Here's my problem...

Here's the code for the command click button on the second form.

If Text1.Text = True Then
Text1.Text = frmLogin.txtPassword.Text
Else: frmLogin.txtPassword.Text = "syslock"
End If

Can anyone offer the correct code or teach me the correct syntax...

I sincerely appreciate anyone's guidance.


Incidently, Im a moderator at the regedit.com forums. Drop bye for a visit. Great site!!!

Why Can't I Set A TextBox To Another TextBox Variable
This is quite strange. I have the following code

Dim myTextBox as TextBox, myControl as Control

set myControl= MyForm.Controls.Add("Form.TextBox.1", "somename", true)

MsgBox "the new control type is " & TypeName(myControl)

set myTextBox = myControl


The msgbox clear shows the type of the control is "TextBox", but when I tried to set to myTextBox, it gave me "Type Mismatch" error. The same problem occurs for OptionButton. but it's ok for ComboBox.

I'm quite puzzled. Please help.
Thanks.

Copy Data From Textbox On Form#2 To Textbox On Form #1
I have a flexgrid on form #2, and a textbox on both forms #1 and #2. The code below is on form #2.

When I click the flexgrid, the txtMatlCode.Value is populated based on the item in the row I selected. When I exit the form using the cmdExit function, I am hoping to populate the textbox on the other form with the same information.

Note, both forms are opened (shown) when I execute this part of the code.

Funny thing how it takes hours to do simple things like this, and only minutes to do the real impressive stuff! Anyhow, any help that can be provided is appreciated...

Thanks:



Private Sub msgDataGrid_Click()
Dim lcol As Integer

R = msgDataGrid.Row

For lcol = msgDataGrid.FixedCols To msgDataGrid.Cols - 1
msgDataGrid.Col = lcol
msgDataGrid.CellBackColor = &H80000002
Next lcol

Me.txtMatlCode.Value = msgDataGrid.TextMatrix(R, 1)

End Sub


Private Sub cmdExit_Click()
Dim MACODE As String

MACODE = frmMatlSearch.txtMatlCode.Value
frmPartProp.txtMatlCode.Value = MACODE
Me.hide

End Sub

Adding An Image To A RTF Textbox???, Adding Tables To A RTF Textbox??
How can I add an Image to a rtf textbox???

And what about positioning it to the text, left, center, right, top, middle, bottom????

I also would like to be able to add a table to the textbox.

Anyone done this???

/Smirre

Textbox Field Property Vs Textbox.text Property
I was wondering if anyone could offer some insight on using a textbox's fields property verses assigning a value to the textbox in code i.e text1.text = rs.Field(1). Is there obvious advantages of using one over the other?

How To Make Bold Text In One Textbox Bold In Another Textbox
I am writing a somewhat basic chat application, I was on the verge of releasing it when I spotted a bug. When I typed with bold text inside Text1, it only appeared normal inside Text2. Is there any way to have Text2 display the text formatting as well? I would also like to do this with the text colors.

Extracting Datagrid Textbox Value To A Textbox Outside Datagrid
Hello to everybody! I hope you all will be able to help me with this problem!

I have a textbox named 'Textbox2' which is inside a Datagrid. And I have a Label named 'Label1' which is declared outside the datagrid.

I tried to retrieve the 'Textbox2' value from datagrid to the 'Label1' value which is outside the datagrid.
I tried typing the below code...

Label1.text=Textbox2.text

But I get a error message, which is "Name 'Textbox2' is not declared."

Can u guys please help me on how can i retrieve a textbox value from a datagrid and assign it to another textbox value which is outside the datagrid.



Thank you very much!!

Copyright © 2005-08 www.BigResource.com, All rights reserved