473,388 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Windows Form Dictionary

oz
Hi All,
I want to make a dictionary with windows application. My data is html
format. therefore, i use webBrowser control on my windows form. If
the
user click any word in webBrowser control, word mean must browse to
user (like babylon).

I have a windows form. My form has webBrowser control. I fill a html
content with javascript (Dictionary.js) to webBrowser.

Javascript (dictionary.js) can obtain the word if user double click
on
the word.

I must to send this word another windows form. Thus, i will learn
this
word mean.

My question is; Can the javascript call the windows form server
code ?

if it can not, how can i do that?

Note: Visual Studio 2005

Thanks any suggestion.
Öznur

Feb 21 '07 #1
9 3736
hi Oz,

oz wrote:
My question is; Can the javascript call the windows form server
code ?
if it can not, how can i do that?
Note: Visual Studio 2005
If i understand you correctly, then you must use the
webBrowser1_Navigating event of the WebBrowser control.

mfG
--stefan <--
Feb 21 '07 #2
oz
On 21 Þubat, 17:07, Stefan Hoffmann <stefan.hoffm...@explido.de>
wrote:
hi Oz,

oz wrote:
My question is; Can the javascript call the windows form server
code ?
if it can not, how can i do that?
Note: Visual Studio 2005

If i understand you correctly, then you must use the
webBrowser1_Navigating event of the WebBrowser control.

mfG
--stefan <--
Hi Stefan,
I mean, i want to capture text, if user double click on it. I can
capture it with javascript but, i cant sent it dictionary form. (My
dictionary form can give word mean).

I want to capture word (which user double click) and sent it another
form.

Thanks.

Öznur

Feb 22 '07 #3
hi oz,

oz wrote:
>If i understand you correctly, then you must use the
webBrowser1_Navigating event of the WebBrowser control.
I mean, i want to capture text, if user double click on it. I can
capture it with javascript but, i cant sent it dictionary form. (My
dictionary form can give word mean).
Your JavaScript must load a new page, e.g. redirect to
http://dict/captured_word.

You can handle this redirect in the webBrowser1_Navigating event. You
just must cancel in this event the navigation and do what you want with
your url:

namespace WindowsApplication6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
webBrowser1.Navigate("c:/temp/test.html");
}

private void webBrowser1_Navigating(object sender,
WebBrowserNavigatingEventArgs e)
{
e.Cancel = (e.Url.ToString() != "file:///C:/Temp/test.html");
if (e.Cancel)
MessageBox.Show(e.Url.ToString());
}
}
}
My test.html:
<html><body><a href="http://dict?captured">click</a></body></html>

mfG
--stefan <--
Feb 22 '07 #4
oz

Thanks your reply. but i cant use html file. because my word mean in
database, not in seperately html file.

My database structure like this:

tblBooks
-------
intBookId (INT)
strBookName (NVARCHAR(30))

tblPages
--------
intPageId (INT)
intBookId (INT)
strPageContent (NVARCHAR(MAX))
tblWords
------
intWordId (INT)
intPageId (INT)
strWord (NVARCHAR(30))
strMean( NVARCHAR(100))

strPageContent is html content, like this : "<b>Hi, my name is Öznur!
<b>"
I show this content in webBrowser control (windows application).
strWord (in tblWords table) is has every word, like :

"Hi" , "name", "Öznur"

strMean (in tblWords table) is has every word mean, like,

"used in greating", "reputed", "some body has light".

If user double click webBrowser content part; like "Hi", the other
windows form (Dictionary.cs) must appear (like popup) and say : "used
in greating". in the same way, if user double click over "Öznur" word,
the other windows form (Dictionary.cs) appear and say: "some body has
light", and so on.

In other words, i cant use html file or <atag or link style or other
web page, because database binding. i cant use web application so web
form, because user does not have iis.

I obtain the word which double click with javascript, but i cant
create some windows form (dictionary.cs) via javascript. Therefor, i
cant show word mean on dictionary.cs form.

Thanks.

Öznur

On 22 Þubat, 14:43, Stefan Hoffmann <stefan.hoffm...@explido.de>
wrote:
hi oz,

oz wrote:
If i understand you correctly, then you must use the
webBrowser1_Navigating event of the WebBrowser control.
I mean, i want to capture text, if user double click on it. I can
capture it with javascript but, i cant sent it dictionary form. (My
dictionary form can give word mean).

Your JavaScript must load a new page, e.g. redirect tohttp://dict/captured_word.

You can handle this redirect in the webBrowser1_Navigating event. You
just must cancel in this event the navigation and do what you want with
your url:

namespace WindowsApplication6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
webBrowser1.Navigate("c:/temp/test.html");
}

private void webBrowser1_Navigating(object sender,
WebBrowserNavigatingEventArgs e)
{
e.Cancel = (e.Url.ToString() != "file:///C:/Temp/test.html");
if (e.Cancel)
MessageBox.Show(e.Url.ToString());
}
}

}

My test.html:
<html><body><a href="http://dict?captured">click</a></body></html>

mfG
--stefan <--
Feb 22 '07 #5
oz
if i create a form or write server code in javascript, i can create a
form (dictionary.cs) and show word mean on form. but how?

may be another way is exist, but i dont know.

if you know other way for this situation, please share with me.

Thank you again.

Öznur
On 22 Åžubat, 20:23, "oz" <oznurkarakuso...@gmail.comwrote:
Thanks your reply. but i cant use html file. because my word mean in
database, not in seperately html file.

My database structure like this:

tblBooks
-------
intBookId (INT)
strBookName (NVARCHAR(30))

tblPages
--------
intPageId (INT)
intBookId (INT)
strPageContent (NVARCHAR(MAX))

tblWords
------
intWordId (INT)
intPageId (INT)
strWord (NVARCHAR(30))
strMean( NVARCHAR(100))

strPageContent Â*is html content, like this : "<b>Hi, my name is Öznur!
<b>"
I show this content in webBrowser Â*control (windows application).

strWord (in tblWords table) is has every word, like :

"Hi" , "name", "Öznur"

strMean (in tblWords table) is has every word mean, like,

"used in greating", "reputed", "some body has light".

If user double click webBrowser content part; like "Hi", the otherwindowsform (Dictionary.cs) must appear (like popup) and say : "used
in greating". in the same way, if user double click over "Öznur" word,
the otherwindows form (Dictionary.cs) appear and say: "some body has
light", and so on.

In other words, i cant use html file or <atag or link style or other
web page, because database binding. i cant use web application so web
form, because user does not have iis.

I obtain the word which double click with javascript, but i cant
create somewindows form (dictionary.cs) via javascript. Therefor, i
cant show word mean on dictionary.cs form.

Thanks.

Öznur

On 22 Þubat, 14:43, Stefan Hoffmann <stefan.hoffm...@explido.de>
wrote:
hi oz,
oz wrote:
>If i understand you correctly, then you must use the
>webBrowser1_Navigating event of the WebBrowser control.
I mean, i want to capture text, if Â*user double click Â*on it. Â*I can
capture it with javascript but, i cant sent it dictionary form. (My
dictionary form can give word mean).
Your JavaScript must load a new page, e.g. redirect tohttp://dict/captured_word.
You can handle this redirect in the webBrowser1_Navigating event. You
just must cancel in this event the navigation and do what you want with
your url:
namespace WindowsApplication6
{
Â* Â* Â*public partial class Form1 : Form
Â* Â* Â*{
Â* Â* Â* Â* Â*public Form1()
Â* Â* Â* Â* Â*{
Â* Â* Â* Â* Â* Â* Â*InitializeComponent();
Â* Â* Â* Â* Â*}
Â* Â* Â* Â* Â*private void Form1_Load(object sender, EventArgs e)
Â* Â* Â* Â* Â*{
Â* Â* Â* Â* Â* Â* Â*webBrowser1.Navigate("c:/temp/test.html");
Â* Â* Â* Â* Â*}
Â* Â* Â* Â* private void webBrowser1_Navigating(object sender,
WebBrowserNavigatingEventArgs e)
Â* Â* Â* Â* Â*{
Â* Â* Â* Â* Â* Â*e.Cancel = (e.Url.ToString()!= "file:///C:/Temp/test.html");
Â* Â* Â* Â* Â* Â*if (e.Cancel)
Â* Â* Â* Â* Â* Â* Â* Â*MessageBox.Show(e.Url.ToString());
Â* Â* Â* Â* Â*}
Â* Â* Â*}
}
My test.html:
<html><body><a href="http://dict?captured">click</a></body></html>
mfG
--stefan <--- Alıntıyı gizle -

- Alıntıyı göster -

Feb 22 '07 #6
hi oz,

Either I don't understand your problem or you don't understand my solution.

You are displaying some database generated content in a WebBroser
control on a Windows Forms application?
This content uses JavaScript to extract a marked word?

oz wrote:
I obtain the word which double click with javascript, but i cant
create some windows form (dictionary.cs) via javascript.
When you have your word captured with JavaScript, use JavaScript to
redirect your page.
The redirection can be handled with the code i have posted to open your
other form.
mfG
--stefan <--
Feb 23 '07 #7
oz
hi,

>>You are displaying some database generated content in a WebBroser
control on a Windows Forms application?

yes. my windows form bind database and show html content in webBrowser
on Windows form.

>>This content uses JavaScript to extract a marked word
yes, use javascript, and this javascript can capture word (not on link
which word, only double click the word (clear), and obtain the word.).
but i can not create windows form in javascript and i cant send the
word i obtain via javascript.

your source code, give me messagebox (or can create windows form) but,
it use link in html and therefor create new server object. my html
content does not have any link with word.

only i found this method (with javascipt), may be another way exist,
may be javascript method is not necessary but i cant found it.

do you know babylon ? if you use this program, you can see my
situation. Press any word on content, babylon can open the popup, and
give me word's mean. I try to do like this.

thanks.

Öznur

On Feb 23, 11:11 am, Stefan Hoffmann <stefan.hoffm...@explido.de>
wrote:
hi oz,

Either I don't understand your problem or you don't understand my solution.

You are displaying some database generated content in a WebBroser
control on a Windows Forms application?
This content uses JavaScript to extract a marked word?

oz wrote:
I obtain the word which double click with javascript, but i cant
create some windows form (dictionary.cs) via javascript.

When you have your word captured with JavaScript, use JavaScript to
redirect your page.
The redirection can be handled with the code i have posted to open your
other form.

mfG
--stefan <--

Feb 23 '07 #8
hi oz,

oz wrote:
yes, use javascript, and this javascript can capture word (not on link
which word, only double click the word (clear), and obtain the word.).
but i can not create windows form in javascript and i cant send the
word i obtain via javascript.
You shouldn't create a form in JavaScript. Just generate a redirect in it.

http://www.tizag.com/javascriptT/javascriptredirect.php

<script type="text/javascript">
<!--
window.location = "http://www.google.com/"
//-->
</script>

This redirect is handled by my code.
mfG
--stefan <--
Feb 23 '07 #9
oz
Dear Stefan,

http://madduck.net/~madduck/misc/thankyou/

thank you :)

On 23 Þubat, 15:14, Stefan Hoffmann <stefan.hoffm...@explido.de>
wrote:
hi oz,

oz wrote:
yes, use javascript, and this javascript can capture word (not on link
which word, only double click the word (clear), and obtain the word.).
but i can not createwindowsformin javascript and i cant send the
word i obtain via javascript.

You shouldn't create aformin JavaScript. Just generate a redirect in it.

http://www.tizag.com/javascriptT/javascriptredirect.php

<script type="text/javascript">
<!--
window.location = "http://www.google.com/"//-->
</script>

This redirect is handled by my code.

mfG
--stefan <--

Feb 24 '07 #10

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

Similar topics

2
by: Tim Chmielewski | last post by:
I have been trying to read values from a form into an array on a page without much success and was told to use a Scripting.Dictionary instead. There are a variable number of fields on the form as...
14
by: ericellsworth | last post by:
Hi, I'm trying to use a class to pass variables back and forth from a form opened in dialog mode. I have created a class which invokes a form in its show method, like so: Public Sub Show() '...
3
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work...
7
by: Dan | last post by:
(Using Classic ASP & MS Access) I have a page that has 120 fields on it (mostly checkboxes). I cannot split this into smaller pages. So what i want to do is write a class that handles this. in...
0
by: oz | last post by:
Hi All, I want to make a dictionary with windows application. My data is html format. therefore, i use webBrowser control on my windows form. If the user click any word in webBrowser control, word...
4
by: arorap | last post by:
I've mod_php installed with Apache 2.2. In one of my folders, I'm using the cgihandler as the PythonHandler as my target host runs python only as CGI. Here cgi.FieldStorage() doesn't seem to work....
6
by: Lakesider | last post by:
Dear NG, I want to create a dynamic questionnaire/survey application with .NET / C#. I want to ask questions and have several answer types: Yes/No, 1-10, list of answers, eg. "Dog", "Bird" and...
20
by: Joel Teichroeb | last post by:
In trunk of the svn there is a folder called PCbuild. Now lets say that I am running linux on my Personal Computer and want to build python. I go into the PCbuild directory, but wait. This is for...
11
beacon
by: beacon | last post by:
Hi everybody, I created a database that links one table from an ODBC data source. I saved my password and UID to the data source so neither myself nor anyone else would have to login each time...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.