473,800 Members | 3,056 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding textbox to rtb in vb 6

15 New Member
I am designing an editor program using rich text box in vb 6.0. I want to add a special box for entering verse or poems so that when I click a button, this box is placed at current position of cursor e-g if cursor is at line#3, the box is placed at line#3 and focus is changed from rtb to box. And after entering text in this box, when i click rtb, focus is changed from box to rtb, also cursor is placed below this box. Also I want that when I save the document, this box is also saved with. I have tried adding text box to accomplish these tasks but i am having problem setting position of textbox, setting focus and position of cursor. Also I dont think it can be saved with document. Is there a way to accomplish this by adding some box to rtb?
Dec 6 '08 #1
5 2443
Dököll
2,364 Recognized Expert Top Contributor
Are you asking about a floating textbox... This sounds pretty interesting. Can you break it down a bit?

I know SelText can set focus on a certain, designated text. I suspect you'll need to use that in your code. As far as movement, perhaps you can write a function to control position of the textbox, which would then allow you to move it.

If I see anything, I'll post ...

In a bit!
Dec 13 '08 #2
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

Try This Code:

Expand|Select|Wrap|Line Numbers
  1. Dim MyStr As String
  2. Dim TotRTF As String
  3. Dim MyText As String
  4. MyText = "MY TEXT BOX"
  5. MyStr = "\par \trowd\trgaph108\trleft36\cellx1636\pard\intbl "
  6. MyStr = MyStr & MyText & "\cell\row\pard\par"
  7. With RTB
  8.     .SelText = Chr(&H80)
  9.     TotRTF = .TextRTF
  10.     TotRTF = Replace(.TextRTF, "\'80", MyStr)
  11.     .TextRTF = TotRTF
  12. End With
  13.  
Regards
Veena
Dec 15 '08 #3
yuleball
15 New Member
Hi Veena, Sorry for late reply. I hav tried this code but its not working. I hav added this code to the menu entry "Add TextBox". When i click this menu item only a character is printed. Maybe i'm not using it correctly.
If I add a textbox is it possible to change its size using mouse at runtime? And can i save it with rtb document?
Dec 22 '08 #4
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

I Guess, it is not possible to change the size at runtime..
The Code works Perfect here..
It IS not an Actual TextBox,
A Single-Row-Single-Colmn-Table is being added to the exisiting RTB at the selected Cursor Position....
from the code, "cellx1636"
change 1636 to some other number top change the width..

Regards
Veena
Dec 22 '08 #5
yuleball
15 New Member
thnx veena but i want smthg whose size can be changed
Dec 31 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
5292
by: Sue | last post by:
On code-behind page: (attributes set programatically for each of these elements) linkbutton added to tablecell textbox added to tablecell tablecells added to tablerow tablerow added to table (table.ID is TestTable) On .aspx page: <HeaderTemplate> <asp:Table ID="TestTable" runat="Server" /> </HeaderTemplate>
3
4888
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that the best method? Do you have a sample of how to do this?
0
1416
by: Luis Esteban Valencia | last post by:
Please help me if possible Its only adding a row. When I click again it steps into the function but doesnt add it to the page. Private Sub LinkButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LinkButton2.Click Dim tcells As TableCellCollection
0
2408
by: Luis Esteban Valencia | last post by:
Hello I wrote a program with code behind in C# to add row into table dynamically and the program worked very well in .Net Framework 1.1. When I run this program in .Net Framework 2.0 beta version, the program is not working as in version 1.1. So what is the problem? Microsoft declared that the version 2.0 is fully backward support, but it is not. Is that the problem with 2.0 version? I find out the problem in version 2.0. After...
6
4434
by: Rudy | last post by:
Hi all, I know this is easy, just can't seem to get it. I have a windows form, and a text box, with a value already in it. I need to add that value to a table. It's just one value, so the entire row doesn't get filled. I have a connection and all that stuff. Private Sub btnPlaceBet_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPlaceBet.Click ' Dim Myds As Footbet.DStable '...
3
4347
by: Husam | last post by:
Hi EveryBody: I made project by Vb.Net which consist the following items: 1\ Textbox 2\Button 3\Listbox When you write any thing in the textbox and press the button any text written in the textbox will be added to the listbox, but i figure that when
4
1672
by: Duncan Dimech | last post by:
Dear All I am writing a tool which requires to have controls added to it dynamically. To make the task more complex, the addition of the control cannot happen anywhere but it has to be instead of a token example <pthis is a test <textbox /and a text box should be entered </P> the tool should render the message and instead of <textbox /it should
0
1969
by: ganesh22 | last post by:
Hi... Iam using GridView in asp.net(2.0) .My requirement is user can add,update,delete in gridview I written the code for add & update but can u help adding rows in grid view My code: <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="3" Height="237px" Style="z-index: 100; left: 155px; position: absolute; top: 132px" Width="688px" BackColor="White" BorderColor="#CCCCCC"...
2
1383
by: ganesh22 | last post by:
Hi, the below code is for dynamically adding textbox, but it will adding for same textbox only my requirement is how many times i click add button such times textbox will add for ex: if i click 10 times add button 10 textboxs will add Session = "3"; for (int a = 0; a < int.Parse(Session.ToString()); a++) { TableRow tr = new TableRow(); TableCell tc = new TableCell();
2
7669
by: Ken Fine | last post by:
I want to add the security question and answer security feature to the ChangePassword control. I am aware that this functionality is built into the PasswordRecovery tool. I have implemented the PasswordRecovery with a Password reset required; a temporary password is sent to the account on file. I want an extra layer of security to accommodate the very unlikely contingency that someone's e-mail account is compromised. Challenging with the...
0
9689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10495
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10269
jinu1996
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...
1
10248
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,...
1
7573
isladogs
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...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4148
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
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.