Article ID: 196575
Article Last Modified on 8/25/2005
DhCell cell=new DhCell(); // Create a DhCell element.
cell.setValue(10); // The value of the cell is 10.
cell.setText("Hello"); // The value of the cell is now 0.
int cellValue = cell.getValue(); // cellValue=0.
The following four instructions yield a value of 123 because setText is
called with an integer value (123):
DhCell cell=new DhCell(); // Create a DhCell element.
cell.setValue(10); // The value of the cell is 10.
cell.setText("123"); // The value of the cell is now 123.
int cellValue = cell.getValue(); // cellValue=123.
import com.ms.wfc.html.*;
import com.ms.wfc.core.*;
import com.ms.wfc.ui.*;
public class Class1 extends DhDocument
{
public Class1()
{
initForm();
}
private void initForm()
{
}
protected void onDocumentLoad(Object sender, Event e)
{
DhTable table=new DhTable();
table.setBorder(1);
add(table);
DhRow row=new DhRow();
table.add(row);
DhRow row2=new DhRow();
table.add(row2);
DhCell cell=new DhCell();
row.add(cell);
cell.setValue(5);
row2.add(new DhCell("value:"+cell.getValue())); // 5
cell=new DhCell();
row.add(cell);
cell.setValue(12);
cell.setText("HelloWorld");
row2.add(new DhCell("value:"+cell.getValue())); // 0
cell=new DhCell();
row.add(cell);
cell.setText("-10");
row2.add(new DhCell("value:"+cell.getValue())); // -10
cell=new DhCell();
row.add(cell);
cell.setText("38.3");
row2.add(new DhCell("value:"+cell.getValue())); // 0
}
}
<HTML>
<BODY>
<hr>
<OBJECT classid="java:com.ms.wfc.html.DhModule"
height=0 width=0 ... VIEWASTEXT>
<PARAM NAME=__CODECLASS VALUE=Class1>
<PARAM NAME=CABBASE VALUE=Project1.CAB>
</OBJECT>
<!-- Insert HTML here -->
<FONT color=BLUE>
<SPAN id="coloredText">Testing...</SPAN>
</FONT>
</BODY>
</HTML>
5 HelloWorld -10 38.3 value:5 value:0 value:-10 value:0
Keywords: kbprb kbwfc KB196575