473,395 Members | 1,863 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,395 software developers and data experts.

vb.net windows application code to c#,asp.net web application code

I have changed the following original vb.net window application code

Expand|Select|Wrap|Line Numbers
  1. Public Overrides Function SetTheme(ByRef frmObj As 
  2. System.Windows.Forms) As Boolean
  3.  
into c#.net as-

Expand|Select|Wrap|Line Numbers
  1. public override bool SetTheme(ref System.Windows.Forms frmObj)
  2.  
..

Later on changed to

Expand|Select|Wrap|Line Numbers
  1.  
  2. public override bool SetTheme(ref System.Web.UI.Page frmObj)
  3.  
  4.  
.....since it is to be used in ASP.NET web application(webform).

Then I m getting errors in following code

Expand|Select|Wrap|Line Numbers
  1. frmObj.TransparencyKey = this.TransperncyColor;
  2.  
Error:System.Web.UI.Page does not contain definition for
TransparencyKey

Expand|Select|Wrap|Line Numbers
  1. frmObj.BackgroundImage.FromFile(this.BackGroundImage)
  2.  
Error :System.Web.UI.Page does not contain definition for
BackgroundImage.

Again getting errors in following code.

Expand|Select|Wrap|Line Numbers
  1. foreach (Control cntl in  frmObj.Controls)
  2.    {
  3.  
  4.             if ((cntl) is DropDownList)
  5.             {
  6.     cntl.ForeColor = Color.Red;
  7.  
  8.             }
  9.            else
  10.            {
  11.     cntl.ForeColor = Color.Black;
  12.            }
  13.  
  14.     }
  15.  
Error:System.Web.UI.Control does not contain definition for Forecolor.

I have used namespace 'using System.Drawing'.

How to debug it ?
Jul 26 '07 #1
5 1930
r035198x
13,262 8TB
I have changed the following original vb.net window application code

Expand|Select|Wrap|Line Numbers
  1. Public Overrides Function SetTheme(ByRef frmObj As 
  2. System.Windows.Forms) As Boolean
  3.  
into c#.net as-

Expand|Select|Wrap|Line Numbers
  1. public override bool SetTheme(ref System.Windows.Forms frmObj)
  2.  
..

Later on changed to

Expand|Select|Wrap|Line Numbers
  1.  
  2. public override bool SetTheme(ref System.Web.UI.Page frmObj)
  3.  
  4.  
.....since it is to be used in ASP.NET web application(webform).

Then I m getting errors in following code

Expand|Select|Wrap|Line Numbers
  1. frmObj.TransparencyKey = this.TransperncyColor;
  2.  
Error:System.Web.UI.Page does not contain definition for
TransparencyKey

Expand|Select|Wrap|Line Numbers
  1. frmObj.BackgroundImage.FromFile(this.BackGroundImage)
  2.  
Error :System.Web.UI.Page does not contain definition for
BackgroundImage.

Again getting errors in following code.

Expand|Select|Wrap|Line Numbers
  1. foreach (Control cntl in  frmObj.Controls)
  2.    {
  3.  
  4.             if ((cntl) is DropDownList)
  5.             {
  6.     cntl.ForeColor = Color.Red;
  7.  
  8.             }
  9.            else
  10.            {
  11.     cntl.ForeColor = Color.Black;
  12.            }
  13.  
  14.     }
  15.  
Error:System.Web.UI.Control does not contain definition for Forecolor.

I have used namespace 'using System.Drawing'.

How to debug it ?
Moved from the Java(!) to the .NET forum.
Jul 26 '07 #2
Plater
7,872 Expert 4TB
All of those are specific to windows application controls. Just remove them.
Jul 26 '07 #3
But I need to use them in web application.so could you tell me what are the other ways I can approach ? and is it the correct way to convert-

Expand|Select|Wrap|Line Numbers
  1. public override bool SetTheme(ref System.Windows.Forms frmObj)
  2.  
into-
Expand|Select|Wrap|Line Numbers
  1. public override bool SetTheme(ref System.Web.UI.Page frmObj)
  2.  
...to use in ASP.NET web application.Is it for this conversion,I am getting the errors ?





All of those are specific to windows application controls. Just remove them.
Jul 27 '07 #4
Plater
7,872 Expert 4TB
But they are no longer applicable. Like the concept of themes is a windows only thing (determines if your program looks like windows2000 or winxp)

And another one was setting a transparency color on the form. That is done with CSS not backend code.

You should be looking up the individual commands to see if they even apply to a web-based application
Jul 27 '07 #5
ok.Thanks for the suggestion :)
Jul 30 '07 #6

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

Similar topics

9
by: Rajat Tandon | last post by:
Hello there, I am relatively new to the newsgroups and C#. I have never been disappointed with the groups and always got the prompt replies to my queries.This is yet another strange issue, I am...
4
by: Kristof Despiere | last post by:
Suppose you have one domain, filled with a couple of users. What needs to be done now is I need to start a windows application from a webform by pressing a button on the webform (for example). ...
17
by: Jon B | last post by:
Hi All! I have a ASP.NET 2.0 site that works on the Windows 2000 Server. However, when I tried to view this site on my local Windows XP machine, I get "Server Unavailable". If I switch the...
1
by: freesteel | last post by:
I have posted about this problem before. SInce then I found a much better article to help with embedding python in a multithreaded application: http://www.linuxjournal.com/article/3641 I...
5
by: sonali_reddy123 | last post by:
Hello all, I am trying to develop an application which will run as a windows service. The application should have Normal options available with service like start, stop and pause but along...
15
by: =?Utf-8?B?TVNU?= | last post by:
To demonstrate my problem, I have a very simple VB Windows application. It has a text box that is used to display a counter, a button to reset the counter, and a timer that increments the counter...
2
by: =?Utf-8?B?dmlzaHJ1dGg=?= | last post by:
Hi, I have 2 applications running, one Windows application project and the other windows services project. I want to call my Windows application in my windows services. I want to run them as...
1
by: =?Utf-8?B?dmlzaHJ1dGg=?= | last post by:
Hi, I have 2 applications running, one Windows application project and the other windows services project. I want to call my Windows application in my windows services. I want to run them as...
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: List of autostart locations Linked from the Original article- "Windows Autorun FAQs: Description". Que: Can you list all the autostart locations for windows? Ans: Here is...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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:
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...
0
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,...
0
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...

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.