devxlogo

Tip Bank

Programatically Set or Change DataRow‘s RowState

The .NET Framework 2.0 adds a new feature: SetAdded, SetModified. You use this feature to set DataRow‘s RowState value programatically. This is applicable only when the current DataRow‘s RowState is

Create a JavaFX foreach Nested Loop

When you want to create a nested loop in JavaFX, use the foreach statement. Here’s an example that displays a circle model: import java.lang.*;import javafx.ui.*;import javafx.ui.canvas.*;Frame { centerOnScreen: true visible:

Serialize and Deserialize an Object Instance to XML

To serialize an object instance to XML, you need to use the XMLSerializer class’s Serialize method. The code snippet below demonstrates: XmlSerializer xmlSer = new XmlSerializer(objInstance.GetType());System.Text.StringBuilder sb = new System.Text.StringBuilder();System.IO.StringWriter

Build a Frame with a ScrollPane in JavaFX

What follows is a simple frame designed with the JavaFX scripting language. The frame also has a ScrollPane component. import javafx.ui.*;import javafx.ui.canvas.*;import javafx.ui.filter.*;import java.lang.System;Frame { centerOnScreen: true visible: true height:

Set the Computer’s Name Through .NET

You can set your computer’s name using the SetComputerName function, which is available in kernel32.dll: //Codeusing System.Runtime.InteropServices; [DllImport(“kernel32.dll”)] static extern bool SetComputerName(string lpComputerName); bool status = SetComputerName(“MyDen”);

Set Multiple Fonts Using Single CFont Object

Did you know you can set multiple fonts for several controls using a simple CFont object in MFC? Using the Detach() method, which disassociates the associated window object from a