|
I'm doing that already. Looks like sh*t.
|
|
|
|
|
Your problem statement is not clear. Can you explain it a bit more ?
|
|
|
|
|
Hi,
Thanks for your interest. I have a data application in which some boolean choices as represented by radio button pairs and at certain points in the application I am representing the data to the user in ReadOnly TextBoxes where applicable. I would like to emulate this functionality in a representation of the RadioButton and am looking for a path of least resistance to accomplish this task. Any help would be greatly appreciated.
|
|
|
|
|
Change the font color back to black after disabling the button?
|
|
|
|
|
I've taken a different approach by building my own custom control that inherits from System.Windows.Forms.RadioButton NameSpace. I'm using GDI+ to alter the presentation of the interface based off a boolean public property I've exposed called 'ReadOnly'. I'm still trying to workout how to cancel 'Click' the click event. Any help would be greatly appreciated.
|
|
|
|
|
You can stop the click Event by overriding the OnClick method in RadioButton class and Removing the call to the base class. like:
protected override void OnClick(System.EventArgs e)<br />
{<br />
}<br />
-- modified at 12:27 Monday 14th November, 2005
|
|
|
|
|
Hi, and thanks for your interest. I tried your suggestion but when I tried to build the control I received an error 'RadioButtonRocLib.RadioButtonRoc.onclick(System.EventArgs)': no suitable method found to override".
|
|
|
|
|
correct code is:
<br />
protected override void OnClick(System.EventArgs e)<br />
{<br />
}<br />
Here 'OnClick' 's 'O' and 'C' character should be in upper case. I don't know why it is not shown correctly.
|
|
|
|
|
Hi,
I have a little problem with a networkapplication i'm creating at the moment. I'm making a program where a windows service (in C#) sends information (username etc) to a java server. I have done some research allready for getting the current username in Windows:
WindowsIdentity temp = WindowsIdentity.GetCurrent().Name;
Now my problem is that i don't receive a logonname on my java server. Instead of that i get the following:
NT AUTHORITY\Lokale service
I tried some other examples (importing dll's etc) for getting the username but always gets the same reply. I really dont know how i can solve this. Does anyone has an idea what went wrong? You would help me alot...
Greetings
Steven Bruneel
|
|
|
|
|
VampireLord wrote: NT AUTHORITY\Lokale service
That is the log on name. It is a limited internal one that windows uses. Your windows service must be running in it. ASP.NET, for example, uses it on certain editions of windows.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
Is there any way to get the 'real' windows login name then? Because it's that one i need to be send to my server.
I made my service in Microsoft Visual Studio .NET 2003 and installed it with the tool included in this program. The service is indeed set as 'Local' but i just don't get it why the username is "Local Service" then, it should be the name from my windows account no? *confused*
|
|
|
|
|
VampireLord wrote: Is there any way to get the 'real' windows login name then?
That is the "real" windows account name. I don't think you could login with it. What you are seeing in the Services applet is the friendly name
VampireLord wrote: The service is indeed set as 'Local' but i just don't get it why the username is "Local Service" then, it should be the name from my windows account no?
If it is "Local Service" then the real name should be NT AUTHORITY\LocalService
Find the service, right click select "properties". Go to the "Log On" tab and see what real account name it is using.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
Ok, i tried something else now. In the properties of my service (called NWDUpdate) there was a property where the service signed on with the "local service"-account. I switched this to local systemaccount but i still get not the thing i want.
The thing i get now is "NT AUTHORITY\SYSTEM" as user. Isn't there any way to get just my logon name in windows then?
|
|
|
|
|
VampireLord wrote: The thing i get now is "NT AUTHORITY\SYSTEM" as user
That user is quite a dangerous one to use. It has more privileges that the Administrator account. If your service could be compromised....
VampireLord wrote: Isn't there any way to get just my logon name in windows then?
You can elect to run a service under any account you want. But, as Michael also pointed out, Windows Services are run without user interaction. Most services start up before the user even gets a chance to log on.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
Because a Windows Service can run when there is no interactive user logged on, then you have to jump through a few hoops to find the currently logged on user.
This[^] may be of some use.
Michael
CP Blog [^] Development Blog [^]
|
|
|
|
|
I tried this now but it still gets me "SYSTEM" instead of my current name i logged on with Don't have any problems with getting computer name etc.. Just need to get my current logonname in Windows in stead of "SYSTEM".. *sigh* ;(
|
|
|
|
|
hi, i am facing this trouble (pretty obvious tho')
im working with a xmldocument, the trick is this is coming with some empty attributes
i want to browse for the empty attributes and to get rid of them
this is the example of what do i receive
and under is what ive tried
it does only displays the name of the empty attribute
but do not know how to erase that from the node
SO MANY THANKS IN ADVANCE, PEOPLE !!!
===========================================================
NOW IS LIKE :
example attrib1="" attrib2="yes" attrib3="no" attrib4=""
node attribX=""
-----------------------------------------------------------
SHOULD BE LIKE :
example attrib2="yes" attrib3="no"
node
===========================================================
<br />
XmlDocument xmlDoc = new XmlDocument(); <br />
xmlDoc.Load("nuevo.xml");<br />
XmlNodeList nodes = xmlDoc.SelectNodes("//@*"); <br />
foreach(XmlNode node in nodes) <br />
{ <br />
if (node.Value.ToString() == "")<br />
{<br />
Console.WriteLine(node.Name.ToString());<br />
}<br />
}<br />
Console.ReadLine();<br />
-- modified at 13:21 Saturday 12th November, 2005
|
|
|
|
|
|
ok my problem is..
when i enter this code inside the load event it returns the name of the form opened before this form..
private void editForm_Load(object sender, System.EventArgs e)
{
MessageBox.Show(ActiveForm.Name.ToString());
}
which returns AdminPanel ( which is the previous form ) but what i want is to see editForm ( which is the form i'm currently opening )
i know its because the form is loading and thats why the currently activeform is AdminPanel but i need to see editForm because:
i have a listbox which gets data from mssql and puts the data to listbox, and someforms of i use are inherited from editForm so while this editForm is loading i want to fetch the data from the unique table so i can see the datas in the listbox after the form is loaded
so my code should be something like this..
private void editForm_Load(object sender, System.EventArgs e)
{
Classes.editClass eC = new HalkDanisv03.Classes.editClass(); // create new object
if(ActiveForm.Name.ToString() == "editEmployee")
{
eC.getStaffUsername(xList,"employeeinfo"); // employeeinfo is the name of the tablename
}
else if(ActiveForm.Name.ToString() == "editManager")
{
eC.getStaffUsername(xList,"managerinfo"); //managerinfo is the name of the tablename
}
}
any help would be great..
thx guys..
good coding
|
|
|
|
|
Would this.Name not work?
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
it works thx so much
|
|
|
|
|
FYI, your form isn't "active" until AFTER the Load event completes.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hye,
for personnal need i started a free Imap library, you'll find it at http://xemail-net.sourceforge.net/ .
This library is functionnal under Linux platform (Mono ) beacause I use Mono.Security to manage Certificats in Ssl connection. So If you use Windows please Help me to port this library to Windows.
Thx
eskan.
|
|
|
|
|
Hi
In VB 6 I used to export crystal report to almost any type
This sample “export report to txt file”
Dim myExportFile As String
myExportFile = App.Path + "\temp.xls"
Report.ExportOptions.DiskFileName = myExportFile
Report.ExportOptions.FormatType = crEFTText
Report.ExportOptions.DestinationType = crEDTDiskFile
Report.ExportOptions.RTFExportAllPages = True
Report.Export (False)
But in Visual Studio 2003 I can't Export to plain txt file
Check out this code,
// Set the Export type, this can be:
// PDF, Excel, Word Doc, RTF Doc,
// HTML 3.2, HTML 4.0 or CrystalReport no txt file
// The path/location where the exported file will be saved
string exportFilePath = MY_PATH+"\\RPTFOH\\Report1.DOC";
// Create an instance of the untyped report object
ReportDocument oRpt = new ReportDocument();
// Load the report from disk
oRpt.Load(@"C:\Test\RPTFOH\Report_1.rpt");
// Set the options for saving the exported file to disk
DiskFileDestinationOptions oDest = new DiskFileDestinationOptions();
oDest.DiskFileName = exportFilePath;
// Set the exporting information
ExportOptions oExport = oRpt.ExportOptions;
// Set the destination options
oExport.DestinationOptions = oDest;
// Set the location, this can be:
// DiskFile, ExchangeFolder, MicrosoftMail or NoDestination
oExport.ExportDestinationType = ExportDestinationType.DiskFile;
// Set the Export type, this can be:
// PDF, Excel, Word Doc, RTF Doc,
// HTML 3.2, HTML 4.0 or CrystalReport
oExport.ExportFormatType = ExportFormatType.WordForWindows;
// Call the Export method to export the report
oRpt.Export();
Please it's urgent,
I need to export Report to txt file.
Thanks in advance.
|
|
|
|
|
Hi!
Because one of the export formats is RTF you could use this to create an rtf file. This file can be read by a RichTextBox and saved as plain text.
Hope this helps,
mav
|
|
|
|