|
i think u can use the on click event of the control
and use the SendMessage(hwnd,wparam,lparam,..) to send
a message to the parent window
Regards,
Pramod
|
|
|
|
|
The UserControl needs to raise an event. Any host (parent) can choose to respond to the event if it wants to. This is the .NET way of doing things and it's much better than the old SendMessage way.
Look up events and delegates in the documentation.
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
I cannot us priting the whole pages - I nedd to see the imediate reaktion of Printer
what is the simple way (some sample code - or a c# control ?)to send single commands to old line printer in C#?
Bohdan Mikolasek
softmusic@softmusic.net
|
|
|
|
|
There is no "simple" way to do this. You can find an example of RAW printing here[^] on MSDN. The code is in VB.NET, but is easily convertable to C#.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I dont wont to write to spooler but direct.
Is not possible in c# to write something like "Open a file called LPT1, write to is and close it."
those are the times of stupic basic LPRINT or on Atari OUT Port,char ....
BM
|
|
|
|
|
OK. You can do it the hard way then -> this[^] is how to do it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I used in my VB programss control MIDIPACK from Mabry(no more support). (MIDI IN; MIDI OUT, MIDI FILE,, buffers for input and output, timers
How cann I continue to use it in C#?
I need some simple control for MIDI I/O to rewrite my software for live midi aplikations in C#
Tham You for tips or help
Bohdan Mikolasek
softmusic@softmusic.net
|
|
|
|
|
Hi all, i think that im am OT but i have a questions.
Does exists a website or some other thing where i can find a customized color for the visual studio 2005 editor? i hate the classic white and its really hard to change the colors...
Regards
|
|
|
|
|
Hi all,
Here is the code:
\\----------------------------------------
public void DisplayButtons()
{
string idName = "id" + j;
string divName = "divNamee" + j;
string divId = "divIdd" + j;
string StyleStr = "visibility:visible; position:absolute; left:" + xPosCityValue + "; top:" + yPosCityValue + ";";
Response.Write("<DIV NAME = '" + divName + "' ID = '" + divId + "' runat = \"server\" STYLE = '" + StyleStr + "'>" + "<input type='image' runat='server' SRC='bulletNew.gif' ALT='" + curCityName + "' id='Image1' onserverclick='Image1_ServerClick'>" + "</DIV>");
}
protected void Image1_ServerClick(object sender, ImageClickEventArgs e)
{
Response.Write("Hello");
}
\\----------------------------------------
On clicking the imagebutton, the event doesnt trigger. I have no idea where I am going wrong. Someone Please help me. This is really urgent.
Nitya.
-- modified at 6:26 Monday 23rd January, 2006
|
|
|
|
|
That is because you are not using a server control. If you simply write out the html code for the control, the runat and onserverclick properties simply ends up in the html code, where they are totally meningless. The runat and onserverclick properies only work if you have them in code that is parsed into the page.
In this case I would simply create server objects for the elements, add the event to the OnClickproperty of the button, and add the objects into a Controls collection of an element in the page.
---
b { font-weight: normal; }
|
|
|
|
|
Thank you for the prompt reply. I did not get you clearly. I would be very happy if you could brief little more on this with some example code. I once again thank you for the reply. (I am waiting for your reply).
Nitya.
|
|
|
|
|
What was it that you didn't understand?
---
b { font-weight: normal; }
|
|
|
|
|
Response.Write(" " + "runat='server' SRC='bulletNew.gif' ALT='" + curCityName + "' id='Image1' onserverclick='Image1_ServerClick'>" + " ");
}
You said that i need to make the "image button" as a server control, which I had already done in the above code (the attribute in the bold text).
Also, I want to ask whether it is possible to call C# method from javascript.
Thanks in advance. Please reply soon. I am eagerly awaiting.
Nitya.
|
|
|
|
|
No, it's not a server control. It's just some text in a string. Just because the string contains "runat='server'" doesn't mean that anything happens. The string could just as well contain "kill all humans", but that wouldn't happen either.
To be a server control it has to be a real object, in this case an HtmlInputImage object.
There are generally two ways of creating server controls:
1. Put the tag in the aspx page so that it is parsed into the Page object.
2. Create the object in the code behind and add it to the page structure.
nitya_arysys wrote: Also, I want to ask whether it is possible to call C# method from javascript.
Not directly. Consider these two rules:
1. The server side code and the client side code never exist in the same place.
2. The server side code and the client side code never exist at the same time.
If you want a Javascript to make anything happen on the server, you have to post the page back to the server and make the C# code detect what it is supposed to do.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks Guffa for clarifying.
|
|
|
|
|
Hello,
I try to sort my ultragrid1 in a button_click methode but I've no idea how to handle the ultrawingrid.
Something like ultragird1. sort column["column"] ???
Can anybody help me.
|
|
|
|
|
Hi Frank,
use ultraGrid1.DisplayLayout.Bands[0].SortedColumns.add(YourColumn col)
hope that helped
GanDad
|
|
|
|
|
I am trying to use the C++ funtions in C# through DLL reference.
I need to pass values by reference to these functions.
How is this possible in C#?
Thanks and Regards
Madhu
|
|
|
|
|
how to get the multile values from a listbox in html and javascript.
and how to pass muliple option from a drop down to the stored procedure as a comma separated string and then pass the values to the conditional clause of the procedure.
sathy
|
|
|
|
|
i'm trying to add my own custom section in my config file, i've found some articles on this in VB that work, but when i rewrite it into C# i get an error, can someone please help?
this is the config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="myGroup">
<section name="myCustomSection"
type="System.Configuration.NameValueSectionHandler,
System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"/>
</sectionGroup>
</configSections>
<myGroup>
<myCustomSection>
<add key="mykey" value="myvalue" />
</myCustomSection>
</myGroup>
</configuration>
this is my C# code:
NameValueCollection nvc = new NameValueCollection();
nvc = ((NameValueCollection)ConfigurationSettings.GetConfig("myGroup/myCustomSection"));
string Value = nvc["mykey"];
this is the error i get from line 2 of code:
An unhandled exception of type 'System.Configuration.ConfigurationException' occurred in system.dll
Additional information: Could not create System.Configuration.NameValueSectionHandler,
System, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
Of all the things i've lost i miss my mind the most...!
-- modified at 4:29 Monday 23rd January, 2006
|
|
|
|
|
You should change this line in your .config file from:
<br />
<section name="myCustomSection"<br />
type="System.Configuration.NameValueSectionHandler,<br />
System, Version=1.0.5000.0, Culture=neutral,<br />
PublicKeyToken=b77a5c561934e089"/><br />
to
<br />
<section name="myCustomSection" type="System.Configuration.NameValueSectionHandler, <br />
system, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" /><br />
<br />
DevIntelligence.com - My blog for .Net Developers
|
|
|
|
|
Excelent, it works!
Thank You...!!!!!!!!!!!!!!!!
|
|
|
|
|
|
At first, I apologize for my english.
I have a problem, which now I don't have any kinds of solution of it.
My program is minimizing into the tray and becomes invisible in the Windows taskbar. It happends this way:
this.WindowState = FormWindowState.Minimized;
this.ShowInTaskbar = false;
And after this actions I cannot shutdown the computers or restart the system until I unload (close)my program by hand.
Could you give me an advise what to do to solve my trouble.
Thanks in advance.
|
|
|
|
|
I take it you're handing the form's Closing event and cancelling the Close so you can, instead, minimize the form? This is where your problem is. Since your cancelling the Close, your app never closes and it causes Windows to abort the Logoff/Shutdown.
You might want to read this[^] little tidbit under "System Notification Tray".
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 12:05 Monday 23rd January, 2006
|
|
|
|