Click here to Skip to main content
15,895,746 members
Home / Discussions / C#
   

C#

 
GeneralRe: Finding the * Pin
Eric Gunnerson (msft)11-Oct-02 10:52
Eric Gunnerson (msft)11-Oct-02 10:52 
GeneralRe: Finding the * Pin
David Stone11-Oct-02 13:48
sitebuilderDavid Stone11-Oct-02 13:48 
GeneralEmail header Pin
Tomas Petricek9-Oct-02 12:11
Tomas Petricek9-Oct-02 12:11 
GeneralRe: Email header Pin
leppie9-Oct-02 12:50
leppie9-Oct-02 12:50 
QuestionAbstract Class instance? Pin
ximian9-Oct-02 10:47
ximian9-Oct-02 10:47 
AnswerRe: Abstract Class instance? Pin
Paul Riley9-Oct-02 11:52
Paul Riley9-Oct-02 11:52 
GeneralRe: Abstract Class instance? Pin
ximian9-Oct-02 14:37
ximian9-Oct-02 14:37 
GeneralRe: Abstract Class instance? Pin
ximian10-Oct-02 2:59
ximian10-Oct-02 2:59 
public abstract class MyControl : System.Web.UI.UserControl
{
public int countoftext = 0;
public string myType;
public string labelname = "";
public Label mylabel;
public int positiontop = 25;
public int positionleft = 100;
public MyControl tempcontrol = new MyControl();



private void Page_Load(object sender, System.EventArgs e)
{


}

private void ReadMenu()
{

XmlTextReader xmlreader = new XmlTextReader("menu.xml");


while (xmlreader.Read())
{

myType = xmlreader.NodeType.ToString();
if (myType.Equals("Text"))
{
countoftext++;
mylabel = new Label();
mylabel.Text = xmlreader.Value;
mylabel.Style["Position"]="Absolute";
mylabel.Style["Top"] = "" + positiontop +"px";
mylabel.Style["Left"] = "" + positionleft + "px";
tempcontrol.Controls.Add(mylabel);<--WONT WORK


}


}

positiontop = positiontop + 20;
xmlreader.MoveToNextAttribute();
}

I guess I wont use a user control and just do it directly from the form. Oh, and some of the code may seen wrong, I am still learning C#, the code actually does work though, because I was able to display other properties without creating labels on the WebForm1.aspx that was using the custom user control, like showing the Encoding of elements in my xml file, or the count, etc blah ..
Eek! | :eek:

GeneralRe: Abstract Class instance? Pin
Paul Riley10-Oct-02 4:05
Paul Riley10-Oct-02 4:05 
Generaldetecting right click on tabcontrol tab Pin
Darryl Borden9-Oct-02 8:52
Darryl Borden9-Oct-02 8:52 
GeneralHandling of unmanaged code by the .NET environment Pin
abhinarulkar9-Oct-02 6:12
abhinarulkar9-Oct-02 6:12 
GeneralRe: Handling of unmanaged code by the .NET environment Pin
Eric Gunnerson (msft)9-Oct-02 8:31
Eric Gunnerson (msft)9-Oct-02 8:31 
GeneralOrder of events when a form is displayed Pin
Wjousts9-Oct-02 2:00
Wjousts9-Oct-02 2:00 
GeneralRe: Order of events when a form is displayed Pin
Daniel Turini9-Oct-02 4:01
Daniel Turini9-Oct-02 4:01 
GeneralRe: Order of events when a form is displayed Pin
Gaul9-Oct-02 5:24
Gaul9-Oct-02 5:24 
GeneralRe: Order of events when a form is displayed Pin
Wjousts9-Oct-02 10:54
Wjousts9-Oct-02 10:54 
Questionhow to do it??? Pin
8-Oct-02 21:04
suss8-Oct-02 21:04 
AnswerRe: how to do it??? Pin
Marc Clifton9-Oct-02 0:10
mvaMarc Clifton9-Oct-02 0:10 
QuestionPlatform invoke??? Pin
Vu Truong8-Oct-02 17:54
Vu Truong8-Oct-02 17:54 
AnswerRe: Platform invoke??? Pin
Stephane Rodriguez.8-Oct-02 19:31
Stephane Rodriguez.8-Oct-02 19:31 
GeneralRe: Platform invoke??? Pin
Vu Truong8-Oct-02 21:08
Vu Truong8-Oct-02 21:08 
AnswerRe: Platform invoke??? Pin
Richard Deeming9-Oct-02 1:22
mveRichard Deeming9-Oct-02 1:22 
AnswerRe: Platform invoke??? Pin
Eric Gunnerson (msft)9-Oct-02 8:25
Eric Gunnerson (msft)9-Oct-02 8:25 
GeneralRe: Platform invoke??? Pin
Jörgen Sigvardsson9-Oct-02 13:43
Jörgen Sigvardsson9-Oct-02 13:43 
GeneralRe: Platform invoke??? Pin
Eric Gunnerson (msft)10-Oct-02 7:58
Eric Gunnerson (msft)10-Oct-02 7:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.