|
This is other stupid doubt
What I want to do is sometinhg like that
panelClass panelCenas = new panelClass(Location, Size, backgruondColor, etc...);
In order to do that, what I have to do in the panelClass?!
I have to erase that?!
public panelClass()
{
InitializeComponent();
}
private void InitializeComponent()
{
this.AllowDrop = true;
//this.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.AutoScroll = true;
this.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
}
Thanks you
|
|
|
|
|
Hi there!
I´m trying to make a class that inherits from a Panel and have several functions.
public class panelClass : System.Windows.Forms.Panel
{
public panelClass()
{
InitializeComponent();
}
private void InitializeComponent()
{
this.BackColor = System.Drawing.SystemColors.ControlDark;
this.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.Location = new System.Drawing.Point(64, 72);
this.Size = new System.Drawing.Size(160, 64);
this.TabIndex = 0;
}
}
In the main program I put this instructions
panelClass panelCenas = new panelClass();
panelCenas.Show();
But when I execute the program the panel that I had created don´t appear =/
What is my mistake here?!! I can´t construct a class panel?!!
Thank you very muck, Sérgio
|
|
|
|
|
Add your panel to the ControlCollection of your form or whatever control should be parent of the panel:
panelClass panelCenas = new panelClass();
this.Controls.Add(panelCenas);
www.troschuetz.de
|
|
|
|
|
The panel doesn't appear by itself, it must be child of a form.
Try doing this in your form constructor:
PanelClass myPanel = new PanelClass();
myPanel.Parent = this; Hope that helps.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
I am using those codes:
[ReadOnly(true)]
public string List
{
get { return m_strList; }
set { m_strList = value; }
}
I wanted to prevent the user to change the List but it changed the color black to light gray bec of readonly changed its color text. I tried to changed its text color(like ViewForeColor). No luck. what are your suggestions that how to change its text color?
|
|
|
|
|
I create a table has a money data type but when i try to insert into it from a form it give me a error convertion
varchar to money type
i use c#
i need help thanks
|
|
|
|
|
In C# the data type is decimal . You use Convert.ToDecimal to parse a string.
string str = reader.GetString(reader.GetOrdinal("Amount"));
decimal amount = Convert.ToDecimal(str); There's also a DataReader.GetDecimal() method, but the above code is to illustrate the point.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
hi,
I have a label in my application. What we can do in current senario is , we can use background color to define background color of my label. What i want is, i can able to define some portion of label to paint in one color and some portion in different color and etc. To be consize, i can able to define any number of color combination in my label. Is there any way to do this.
Sreejith Nair
[ My Articles ]
|
|
|
|
|
i think you have to write your own label control with custom paint method.
there are no facts, only interpretations
|
|
|
|
|
Hi
I developed C# component , when I call that component in my VC.6 Code the CoCreateInstance is failing
hr = CoCreateInstance (theCLSID, NULL, CLSCTX_LOCAL_SERVER, IID_IUnknown, (void**)&pIUnk )
In the above case the CoCreateInstance is failing with the error value of -2147221164 ( Class not registered).
If I modified the code as
hr = CoCreateInstance (theCLSID, NULL, CLSCTX_ALL, IID_IUnknown, (void**)&pIUnk ) ;
everything works fine.Can any one tell why HRESILT is failing in the first case?
Thanks in Advance
kishnasarma
|
|
|
|
|
i'm not an expert on com, but did u try to register your component?
there are no facts, only interpretations
|
|
|
|
|
My C# DLL I made as .msi file and when you run the .msi file
it will do the registration automatically.
|
|
|
|
|
I'm not 100% au-fait with all the technical details of C# COM.
However CLSCTX_LOCAL_SERVER in good old C++ COM was always used for an EXE COM Server. Your C# component is probably a DLL Assembly which is probably created as a CLSCTX_INPROC_SERVER.
CLSCTX_ALL is the catch all value, so thats why that will be working as it will be creating the instance as inproc server.
Michael
CP Blog [^]
|
|
|
|
|
//my c# code:
public class Win32
{......
public static Guid GUID_DEVINTERFACE_USB_DEVICE
= new Guid("A5DCBF10-6530-11D2-901F-00C04FB951ED");
public class SP_DEVICE_INTERFACE_DATA
{
public int cbSize;
public Guid InterfaceClassGuid;
public int Flags;
public ulong Reserved;
}
......
}
public class usbdevice
{
IntPtr hDevInfo;
Win32.SP_DEVICE_INTERFACE_DATA DeviceInterfaceData = new Win32.SP_DEVICE_INTERFACE_DATA();
......
hDevInfo = Win32.SetupDiGetClassDevs(ref Win32.GUID_DEVINTERFACE_USB_DEVICE,
null, // Enumerator
null,
Win32.DIGCF_PRESENT | Win32.DIGCF_DEVICEINTERFACE); //flags
......
DeviceInterfaceData.cbSize = (int)Marshal.SizeOf(new Win32.SP_DEVICE_INTERFACE_DATA().GetType());
bResult = SetupDiEnumDeviceInterfaces(hDevInfo,
null,
ref Win32.GUID_DEVINTERFACE_USB_DEVICE,
memberIndex,
DeviceInterfaceData);
......
}
//after invoked the Win32.SetupDiGetClassDevs(),the hDevInfo is not -1. But the bResult always returns false,what's the problem?
Thanks!
|
|
|
|
|
I'm preparing a thesis about Mobile Agents. I'll need to write some applications and I think of using C# for that. But since I'm new to C#, I don't know whether C# will satisfy my requirements. May anyone help me by answering these questions:
Does C# support RMI?
Does it support Mobility of code, more specific: the mobility of software agents?
To what extent does it support the network programming?
Finally, is it a byte-coded language?
|
|
|
|
|
hi to all,
i would like to create an app (well implement it in an app ive already started) that can handle dropping of toolbox items onto a canvas.
similarly to the way its done in the likes of dreamweaver and flash etc., where a toolbox item is dragged from a toolbar and when it enters the canvas perimiter it changes (visually) to what the item will look like on the canvas, does this need to be a bitmap/png or can i simple display the forms object (or whatever is being dropped) as it will appear after the mouse is released?
my canvas is a richtextbox? will this handle this or do i need to create a custom control as the canvas, items being dropped will vary from form objects to images to text etc.
are there any articles here (or elsewhere) that may assist me, ive tried searching but my search syntax doesnt quite get me the answers im looking for.
i am assuming i will need to create a class that implements the IDataObject interface? or is there another way that is better ?
kind regards
g00fy
|
|
|
|
|
Just for your information: You can use the Modify link in the bottom right corner of a posting to correct it.
www.troschuetz.de
|
|
|
|
|
|
how to use the same variable in c#, in HTML Jug-Head 0:40 2 Nov '04
is there anybody out there, who knows how to use a variable in HTML which was defined in c#.
in c# i use the variable EmbedText.Text=this.openFileDialog();
i want to use that same variable in HTML e.g. <value=mms: streamserver="" embedtext.text="">
Jug-Head
|
|
|
|
|
Patience! Posting your question over and over will not get it answered any faster...
Besides, your question would be better handled in the ASP.NET Forum...
The variable is defined to C# only and is never passed to HTML. So, the only way your going to see the value of the variable is if the C# code passes it to some field in your HTML, such as stored the value in a hidden TextBox...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
sorry about being so impatient. thanx for replying.
is there a possibility that u could show me how what u mean by passing the variable to some field in HTML. i don't have lots of experience with HTML.
|
|
|
|
|
do you mean that you want to assign a asp.net(C#) variable to a javascript variable or something?
"Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18
|
|
|
|
|
Hi~
How to create a new instance of the process if the process is already created in pocket pc? (E.g The "test.exe" is running and i try to run "test.exe" again but no new process is created.)
Thanks
|
|
|
|
|
don't know about pocket. in .NET regular framework this will work:
System.Diagnostics.Process pr1 = new System.Diagnostics.Process();
pr1.StartInfo.FileName = "test.exe";
pr1.Start();
System.Diagnostics.Process pr2 = new System.Diagnostics.Process();
pr2.StartInfo.FileName = "test.exe";
pr2.Start();
there are no facts, only interpretations
|
|
|
|
|
Hi All,
does anyone know how to get a windows Forms application to retrieve the name of the machine it is running on?
Thanks
Mark
|
|
|
|