473,763 Members | 7,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

34 New Member
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(web form).

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 1939
r035198x
13,262 MVP
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(web form).

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 Recognized Expert Expert
All of those are specific to windows application controls. Just remove them.
Jul 26 '07 #3
manjitsarma
34 New Member
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 Recognized Expert Expert
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
manjitsarma
34 New Member
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
2822
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 facing. Please please help me to solve this as soon as possible. So here we go ... I am not able to take the screen shot of the windows form based "Smart
4
2423
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). The problem is that the user who "owns" the service is always the ASPNET account. That's not good since you don't see the actual application (because it's owned by ASPNET). I've tried changed the processmodel section in the machine.config file to...
17
5100
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 Windows XP IIS back to ASP.NET 1.1 then I get the Configuration Error (which is understandable because I'm trying to run an ASP.NET 2 site with 1.1 framework). I can however view other ASP.NET 1.1 sites on my local Windows XP machine. It's only the...
1
3080
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 found this article very good and it clarified for me what needs doing. Now I have an example application that almost works, but it is far from reliable. If I run this several times I get crashes telling me that the heap is modified after deallocation....
5
4263
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 with this I need an option to show the windows application which my service has started as a result of its invokation. So I have written a service control by adding a new project of type
15
7086
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 every second. I remote desktop to the computer hosting this application and run the application. It starts up and displays the counter incrementing every second. If I disconnect the network cable between the two computers for 10 seconds and...
2
4498
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 seperate process. If my windows application starts running,only if it completes fully, then my windows services should continue its execution. My main process is Windows service.
1
4851
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 seperate process. If my windows application starts running,only if it completes fully, then my windows services should continue its execution. My main process is Windows service.
0
30244
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 a comprehensive list of all autostart locations for Windows OSes: NOTE : These are some abbreviations used in this list. Please note them carefully: HKCU = HKEY_CURRENT_USER HKLM = HKEY_LOCAL_MACHINE
0
9563
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
9386
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
10144
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
9822
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...
0
8821
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6642
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
5270
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
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
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

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.