473,775 Members | 2,263 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML file handling/modification in Visual Basic .NET application

Hi,
We're implementing a Windows application using Visual
Basic .NET.
One of the key features we need to implement is that we
should be able to get the accurate byte offset of user
selected text in the file.
We've been trying to use the RichTextBox control to load
a file, and get the offset when the user selects some
text in the file. It's been working ok with regular text
files, but we can't use the RichTextBox control to handle
an HTML file.
We're looking for a control that loads a HTML file,
displays it correctly like web-browser, and
1. can get(return) actual position or byte offset
of user selected text
OR
2. has a feature to allow us to modify HTML source,
and put some tags into the specific location, which user
selected

We want to keep the original HTML source as much as
possible if we need to put our own tags into the file to
remember the selected location.
We've tried some third-party controls that can load HTML
file in VB form, but none of them have the features that
we need, and some of them have some issues like modifying
(converting) original HTML source which we don't want.
Please let us know how to implement this.

Thanks.

Nov 22 '05 #1
7 3102
Hi,

Thanks for your post. As I understand, you want to create a HTML designer
of you own which is able to edit the HTML source and view the result within
your application. Please correct me if there is any misunderstandin g. Now
I'd like to share the following information with you:

1. Based on my experience, I suggest you to create two views in your
application. One is a text editor for a user to edit HTML source; the other
hosts a web browser control which displays the result of the edit view.
Just like IE where I can edit the source outside say, Word, Notepad,
FrontPage, etc.

The following articles describes using Web Browser in C# and VB.NET:
http://www.c-sharpcorner.com/Interne...serInCSMDB.asp

2. If you want a WYSIWYG HTML designer control like those in Visual Studio
..NET IDE, ProntPage, etc, I did a search on www.google.com but did not find
an existing control. We are able to implement one ourselves by applying the
HTML specification, however, it is a time-consuming task and I do not
recommend.

HTML 4.01 Specification
http://www.w3.org/TR/html4/

Please feel free to let me know if you have any problems or concerns.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 22 '05 #2
Tian Min,

Thanks for your response.
Actually, we're not looking for a HTML designer
implementation.
In our application, users see a HTML page(not the source)
just like you see a HTML file in any web browser.
And, when users select some text from anywhere in HTML
viewer, WebBrowser control, HTML control or whatever, we
need to be able to get the exact location of selected
text, so that we can store the offset or something to
reuse it next time.
So, if there is a way to get the exact location(offset )
of selected text, we can then modify the source to put in
a ID tag or something that represent the text has been
selected by user.
Am I addressing our issue clearly? Please let me know.
Thanks again.

Jay

-----Original Message-----
Hi,

Thanks for your post. As I understand, you want to create a HTML designerof you own which is able to edit the HTML source and view the result withinyour application. Please correct me if there is any misunderstandin g. NowI'd like to share the following information with you:

1. Based on my experience, I suggest you to create two views in yourapplication. One is a text editor for a user to edit HTML source; the otherhosts a web browser control which displays the result of the edit view.Just like IE where I can edit the source outside say, Word, Notepad,FrontPage, etc.

The following articles describes using Web Browser in C# and VB.NET:http://www.c- sharpcorner.com/Internet/WebBrowserInCSM DB.asp
2. If you want a WYSIWYG HTML designer control like those in Visual Studio.NET IDE, ProntPage, etc, I did a search on www.google.com but did not findan existing control. We are able to implement one ourselves by applying theHTML specification, however, it is a time-consuming task and I do notrecommend.

HTML 4.01 Specification
http://www.w3.org/TR/html4/

Please feel free to let me know if you have any problems or concerns.
Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
.

Nov 22 '05 #3
Hi Jay,

Thanks for your feedback. As you know, the web browswer will tranlate the
HTML tags and render the content in its view. When a user select some text
anywhere in HTML viewer, I suggest that you may need to get both the
content and coordinate of the text in the HTML viewer and then search it in
the HTML file.

Please feel free to let me know if you have any problems or concerns.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 22 '05 #4
Hi Jay,

Thanks for your feedback. As you know, the web browswer will tranlate the
HTML tags and render the content in its view. When a user select some text
anywhere in HTML viewer, I suggest that you may need to get both the
content and coordinate of the text in the HTML viewer and then search it in
the HTML file.

Please feel free to let me know if you have any problems or concerns.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 22 '05 #5

Hi Tim,
Thanks for your responses.
Actually, I'm trying to test with MSHTML + WebBrowser
control as Peter Huang suggested in
<http://support.microsoft.com/newsgroups/default.aspx?
ICP=GSS3&NewsGr oup=microsoft.p ublic.dotnet.la nguages.vb>
I'm not sure if that will work for my project yet, but it
seems like the right way to go.
Thanks again.

Jay
-----Original Message-----
Hi Jay,

Thanks for your feedback. As you know, the web browswer will tranlate theHTML tags and render the content in its view. When a user select some textanywhere in HTML viewer, I suggest that you may need to get both thecontent and coordinate of the text in the HTML viewer and then search it inthe HTML file.

Please feel free to let me know if you have any problems or concerns.
Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
.

Nov 22 '05 #6

Hi Tim,
Thanks for your responses.
Actually, I'm trying to test with MSHTML + WebBrowser
control as Peter Huang suggested in
<http://support.microsoft.com/newsgroups/default.aspx?
ICP=GSS3&NewsGr oup=microsoft.p ublic.dotnet.la nguages.vb>
I'm not sure if that will work for my project yet, but it
seems like the right way to go.
Thanks again.

Jay
-----Original Message-----
Hi Jay,

Thanks for your feedback. As you know, the web browswer will tranlate theHTML tags and render the content in its view. When a user select some textanywhere in HTML viewer, I suggest that you may need to get both thecontent and coordinate of the text in the HTML viewer and then search it inthe HTML file.

Please feel free to let me know if you have any problems or concerns.
Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
.

Nov 22 '05 #7
Hi Jay,

Thanks a lot for your information. I am very glad to hear that Peter's
suggestion will help you! If you have any problems, please feel free to
post in the thread in dotnet.language s.vb or to this thread.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 22 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2470
by: mustafa | last post by:
Dear sir , I have built my application in visual basic 6.0 and crystal Report8.5 , Now i migrated my application to VB.net using the upgrade wizard.My visual basic form is upgraded to vb.net but my .dsr file that i created using crystalReport is not migrated , when i try to convert it into .rpt file using add new item in Vb.net Envs it give me the error in the log file saying,
6
6160
by: Danny Lesandrini | last post by:
I'm using an Access database to drive a web site and the colors of various table backgrounds are stored in Access. I want users of the Access database to be able to select colors for the site, but my mappings between named colors, HEX values and the Long Integer values used in Access are not jibbing. Anyone have a nice list laying around? Danny J Lesandrini dlesandrini@hotmail.com
2
8403
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when submitting the form to update the database. The server doesn't have the client side value any more. It seems to me that as I begin to write the client side javacript code for form validation and client side editing capabilities in order to save...
4
5731
by: Kenneth Keeley | last post by:
Hi, I have a page that uploads files to my server and I wish to display a "Please wait while uploading" page to the user while the file is uploading. I have been able to redirect the user once the file is finished uploading but am not sure how to do it while file is uploading. Some sample code would be welcomed with open arms. Thank You.
17
2495
by: Lloyd Sheen | last post by:
This IDE is driving me nuts. I needed another button so I copied an existing one, changed the Text and the id and position by drag and drop. Well then I run and get the following: Control 'Button19' of type 'Button' must be placed inside a form tag with runat=server Can the IDE not do what it is supposed to do. It seems that it is a fight to make it do anything or did I do something wrong? It would seem silly to have to create a...
14
3897
by: Al Smith | last post by:
I need help in implementing proper error handling. I am trying to upload a file based on the sample code below. The code works well except if the file selected is too big. I do know about the maxRequestLength parameter of the <httpRuntime> section and that works as expected. What I want is to enforce a max file size but haven't been able to trap the error thrown when the file is too large and that's where I could use some help.
9
2958
by: Jay Kim | last post by:
Hi, We're implementing a Windows application using Visual Basic .NET. One of the key features we need to implement is that we should be able to get the accurate byte offset of user selected text in the file. We've been trying to use the RichTextBox control to load
17
1749
by: marks542004 | last post by:
Hi all , I am an old programmer now hobbyist who has used cobol, basic, and RPG . I am new to c++ but have Microsoft Visual Studio 6.0. I have a program in Basic that reads a file , looks for lines containing a specific string , and lists them. I am trying to do the same thing in C in a search for speed with very
1
1367
by: =?Utf-8?B?TWF1cmljZQ==?= | last post by:
Greeings: Looking for guidance in adding a feature. I would like for authorized users to be able to log into a frontpage 2002 website that I created/published and add laboratory results to data application most likely to be MS Access. Is there something in existence or can a novice do something in a tool like visual basic? Is this feature dependent on the web hosting service? Please advise if this is not the correct place to post....
0
9621
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
9454
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,...
0
10267
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
10106
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...
0
9915
tracyyun
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...
1
7463
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
5358
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...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3611
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.