Jump to content

Check out our Community Blogs


Member Since 30 Mar 2008
Offline Last Active Aug 23 2010 10:48 AM

#461490 [SQL] Manipulate outcoming data

Posted by Xav on 21 May 2009 - 08:52 AM

I thought CASE statements need the word END at the end. Try this:

           WHEN 0 THEN "Male"
           WHEN 1 THEN "Female"
      As Gender

FROM staff s

  • 1

#450847 Screen Size Issues

Posted by Xav on 07 April 2009 - 08:52 AM

I am not really surprised that the form doesn't fit on some monitors. Its height is huge! As a form designer one must ensure that the windows cater for all screen sizes, including 800 x 600 (think netbooks).

The solution is simply to make the form smaller. I would make it wizard-based - start off with an order selection, and then the user clicks Next. Having selected the order, the order controls disappear and in their place the customer details controls appear.
  • 1

#436707 A basic question that i need to know

Posted by Xav on 24 February 2009 - 12:42 PM

Here, let me try and demystify it. :)

There are two types of ASP - Classic ASP and ASP.NET, which uses the .NET framework.

ASP and ASP.NET are pretty much technologies rather than languages - the concept of executing code on the server, then sending the results back as HTML to the browser.

You specify which language you want to code the ASP in - for classic, it's between VBScript and JavaScript. For ASP.NET, you choose a .NET language (understandably), either VB.NET or C#.NET.

When executed, the ASP or ASP.NET is run on the server (using whatever language you programmed it in). And HTML is sent back to the browser.

See? :)
  • 1

#431923 Introduction

Posted by Xav on 05 February 2009 - 01:19 PM

Welcome to CodeCall!

That's not very nice.
  • -1

#427435 If / let / else question

Posted by Xav on 18 January 2009 - 10:52 AM

You simply use the "And" keyword. As in, If Text1.Text = "32" And Text2.Text = "yes" Then

And so on.
  • -1

#425687 The New Google Icon

Posted by Xav on 14 January 2009 - 12:23 PM

I think the older one was clearer.
  • 1

#420850 Wii web browser/ wii programming

Posted by Xav on 31 December 2008 - 12:21 PM

Just meant I would say exact same as you said to this fellow...

It's OK, you may follow in my footsteps. I will be your daddy. :)
  • 1

#419698 MD5 Hash

Posted by Xav on 27 December 2008 - 12:42 PM

It's a shame you are using inbuilt functions instead of using your own algorithm. But what the heck, +rep.
  • -1

#417918 c# colors minigame

Posted by Xav on 21 December 2008 - 11:49 AM

Yes really. It's gonna be warm, don't worry - hot, even. Nice and hot, just the way you like it.
  • 1

#417632 c# colors minigame

Posted by Xav on 20 December 2008 - 12:02 PM

I know exactly what you want.
  • 1

#417619 Ask Me: Termana

Posted by Xav on 20 December 2008 - 11:54 AM

Can't you accept criticism and the fact you are a ******* n00b?
  • -1

#416830 CodeCall Quiz !!

Posted by Xav on 17 December 2008 - 10:36 AM

The search engine based their name on the term "googol". Google is not a mathematical number, but a Googol is.
  • 1

#414189 What this mean? Why ?

Posted by Xav on 09 December 2008 - 11:34 AM

It is a class called "Box". You can now use it to create Box variables, which you can store three values in - an x, y and z value (width, height and depth respectively).

The private variables are the place where the values are stored in each object. The "double" bit indicates the value can be quite precise, such as 15.34504 or 45.020430523 or just 34.
  • -1

#409382 C# Tutorial - How To Open New Forms

Posted by Xav on 20 November 2008 - 12:55 PM

Thanks. Can I have my 20 contest points then?
  • 1

#409365 C# Tutorial - How To Open New Forms

Posted by Xav on 20 November 2008 - 12:39 PM

OK, this question seems to have popped up quite a lot, and it's really quite simple, so here's some details about how to open secondary forms from a main form.


We have a main form. The user clicks "New Order", where the order form pops up. But how does it pop up?

Instance and Static

This is how C# differs to VB. In VB, you have one copy of each form. You can hide and show this form any time you like, but there is one form. You can toggle visibility by using Show() or Hide().

C#, on the other hand, is very different. Here we can only use instance members. What this means is that there is no single copy of the form - if you want to open a form, you must create a new "version" of the form, and display this to the user.

Classes and Objects

In VB, a form name in the code would refer to the actual form object. By typing a period (.), we could access the properties of the form. In C#, the form name is a class. Therefore, we cannot access any properties directly from it. We must create a new object variable, and use the form class to fashion it to the shape of the form we want to show.

The Code

To open the order form, we would do something like this:

frmOrder form = new frmOrder();

Notice how the frmOrder form (the name of our order form) is being used as a class - the actual form object is called "form". Therefore, to access its properties we refer to this, and not the form class.

Suppose we wanted to know the result of the order form:

frmOrder form = new frmOrder();
if (form.ShowDialog() == DialogResult.OK)
MessageBox.Show("You selected the " + form.txtOrder.Text + " item!");
MessageBox.Show("Oh well, maybe next time!");

First, we check the DialogResult enumeration that ShowDialog() returns. If it is DialogResult.OK (under a couple of namespaces, of course) then we grab the contents of the txtOrder textbox on the form. If not, we display a cancellation note (you don't have to do this, of course).


I hope this will be helpful - especially for those migrating from VB to C#. Bear this in mind, and creating new forms will be a doddle.

  • 0

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download