| Can not change application icon |
|
 |
Index ‹ DotNet ‹ Dotnet
|
- Previous
- 1
- Visual C#.Net >> C# property usage questionHi,
I'm new to C#. Most examples about properties I found are sth like the
following:
class A{
private int property;
public int Property {
get { return property; }
set { property = value; }
}
}
My question is, Can I simply do the following:
class A {
public int Property;
}
Then later, if it turns out that I need to do sth when the property is set
or get, I change it to
class A{
public int Property {
get { <do sth>; return ... }
set { <do sth>; }
}
}
This way, the code that uses A should still compile. Am I right? This way
sounds much simpler to me, you don't have to write those repetitive get&set
unless you later find out that you need. Is this the right way of using
properties? Am I missing sth here?
thanks
vh
- 2
- Visual C#.Net >> Getting local admin groups and users on a windows server using ADSIhi all,
i am trying to get local admin users and groups on a windows server.
here is the C# code that i am using
***************************************************************************************************
DirectoryEntry AD = new DirectoryEntry("WinNT://" + sServerName +
",Computer",UserName,Password);
DirectoryEntry admGroup = AD.Children.Find("Administrators", "Group");
object members = admGroup.Invoke("Members", null);
foreach(object member in (System.Collections.IEnumerable)members)
{
DirectoryEntry user_groups = new DirectoryEntry(member);
// do some work.
}
******************************************************************************************************
I have 2 issues here.
1. Its not getting all the local users and groups from the
Administrators group on the box.
2. How does it know which domain to look for with just "WinNT://" +
servername.... i have 2 domains, test and production and both domains
have same server names. i.e there is a AppServer in each of the test
and production domain.
3. Is there a different syntax to tell the DirectoryEntry object to
look at a particular server on a particular domain?
thanks,
shashank kadge
- 3
- Winforms >> Custom DataGridView Columns and CellsHi,
I have an application with a DataGridView that displays a Questionnaires
questions and allows a user to fill in answers to these questions in the
gridview.
Each question knows its questionType (Date, Text, or Yes/No/Na). I have
created a custom column that inherits from datagridviewcolumn and have
created a custom cell that inherits from DataGridViewTextBoxCell.
In my cell object, I get the OwningRow.DataBoundItem to reference the
QuestionObject and then Get the QuestionType of the question in that row.
After I do this, I use a select case statement to determine the type of
editing control I need for Edit purposes. This way, Date questions get a
datepicker edit control, YES/NO/NA questions get a combobox edit control and
Text questions get a text box edit control.
I have my DataGridView displaying the correct type of editing controls when
edit mode is entered on the cell. And my Text Box and DatePicker Edit
controls seem to be working right as well.
I am having a problem with the ComboBox edit control for my custom cell.
Even though I specify the Items list for the combobox, when the combobox is
displayed, none of the items show up in the dropdown and even if I type an
answer in the combobox, it doesn't enter edit mode.
There are also some other strange behaviors going on in terms of values
displayed when entering edit modes and in display mode.
I would really appreciate any help here I can get. This has been a big
problem for me to solve and have gotten close, but not yet complete.
Thanks so much in advance for your help.
Guy
- 4
- Dotnet >> How do I build the project sample to detect and install CFHello friends
I have got a sample code from msdn in the following link.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfdepl.asp
but i am not understanding how to build this project and how to get the .msi
file to start the setup.
if u know please help.
with regards
Meghna
- 5
- Visual C#.Net >> Layout manager issue when docking panels?I was playing around with a new Windows form yesterday. I wanted to drop two
panels on the form. The first would be set Dock=Top. The second would be set
Dock=Fill.
So, I dropped the first panel and set its Dock property to Top. I then dropped
the second panel on the form and set its Dock property to Fill.
Holy disappearing panels, Batman. The second panel filled the entire form
hiding the first panel. So, when I dropped my grid control on the second panel
which was set to Dock=Fill, it filled the entire screen.
I eventually got what I needed by cutting and pasting the controls, which was a
suggestion of a fellow developer at work, but it was a bit annoying.
Is there a bug in the layout manager in the forms designer that is causing this
behavior?
- 6
- Microsoft Project >> Changing resource calendar with a 24 hour project calendarWe have a project that is set up with a 24 hour calendar and resources that
are allocated either to a 24 hour or a 12 hour calendar. If we change a
task with a 24 hour resource calendar to a 12 hour resource calendar, the
task still showed as the resource working through the night as if they were
on the 24 hr calendar.
The task is a fixed unit task.
By doing this, our critical path also changes - any ideas why?
Thanks
- 7
- 8
- Visual C#.Net >> Order of Columns in the Datagrid binding.Hi, Dear gurus,
I want to bind my collection to a datagrid. The field names in my object
show up in a weird order, and I just wonder how I could reorder those
columns .
I find some code like the following , but I don't want to do it that way
because it won't work if I have large number of fields.
[
DataGridTableStyle myGridStyle = new DataGridTableStyle();
myGridStyle.MappingName = "GridTableMappingName";
DataGridTextBoxColumn nameColumnStyle = new DataGridTextBoxColumn();
nameColumnStyle.MappingName = "GridColumnMappingName";
nameColumnStyle.HeaderText= "GridColumnMappingName";
myGridStyle.GridColumnStyles.Add(nameColumnStyle);
myDataGrid.TableStyles.Add(myGridStyle);
]
I believe there must be some better way to do that(using reflection) .
Anybody gives me some hint on that. A link to a example is highly
appreciated.
Thanks,
J.W.
- 9
- Visual C#.Net >> Question: Load bmp and save as jpgI want to convert one bitmap file to another one.
For example load as bmp and save as jpg.
The loading part is simple I do this:
Stream BitmapStream =
File.Open(sSrcFile,FileMode.Open,FileAccess.Read,FileShare.None);
Bitmap imgPhoto=new Bitmap(BitmapStream);
iPixelsX=imgPhoto.Width;
iPixelsY=imgPhoto.Height;
BitmapStream.Close();
The saving will be something like this; but I fail to see how I can hook up
imgPhoto from the load to this stream.:
Stream DestBitmapStream =
File.Open(DstFile,FileMode.CreateNew,FileAccess.Write,FileShare.None);
// how do I connect imgPhoto?
DestBitmapStream.Close();
Also I wonder if the Pixelfomat is different, lest say I load 8 bit indexed
color palette bitmap and want to save as 24 bit RGB jpeg, could this be done
automatic?
Something tells me that I need to copy the bytes manually??? I hope not.
Many thanks.
Olaf
- 10
- Dotnet >> Using ServicePointManagerIs the object global? I would like to ignore ftp server certificate validity
making connection to it in one part of my application. Will it apply the
validation bypass to this thread, process or whole .net platform?
- 11
- Microsoft Project >> Resource Assigment Dates Not Matching Task Level DatesResource Assignment Dates not the same as task level dates.
For Example:
Task: Build Radio - 40 days dur. 1/30/06 to 3/24/06
Resources: John 100hrs & Bill 60hrs.
I want both John and Bill's hours spread evenly across the duration, however
my schedule now in the task usage view shows only John (resource with most
hrs) spread across the duration and Bill's hours are at a much shorter date.
I want them both spread evenly across the entire duration. All of my tasks
are fixed work and they need to stay that way. I can manually go into task
usage and fixed the dates, however once status is taken Project reverts back
to the above.
Is their a setting in project I am missing?
Is it because of fixed work?
Please help!!!!
Thanks,
KG
- 12
- Net Framework >> Memory leakage!!Please look at the following URL:
http://forums.devbox.net/showthread.php?p=3082#post3082
Can anyone suggest me the solution to this?
Thanks a lot!!
- 13
- 14
- 15
|
| Author |
Message |
ksdowns

|
Posted: Mon Oct 06 04:07:25 CDT 2003 |
Top |
Dotnet >> Can not change application icon
A VC.net application, the 3 16777216-color icons, 16*16,
32*32 and 48*48, have been modified, but after rebuild the
application, the icon does not change. Should we modify
anything else to change the icon?
DotNet198
|
| |
|
| |
 |
ATong

|
Posted: Mon Oct 06 04:07:25 CDT 2003 |
Top |
Dotnet >> Can not change application icon
The icon used by system seems to be those 256-color icons.
>-----Original Message-----
>A VC.net application, the 3 16777216-color icons, 16*16,
>32*32 and 48*48, have been modified, but after rebuild
the
>application, the icon does not change. Should we modify
>anything else to change the icon?
>.
>
|
| |
|
| |
 |
Charles

|
Posted: Mon Oct 06 09:08:16 CDT 2003 |
Top |
Dotnet >> Can not change application icon
If you are using XP, then the icon is cached. I know one way to
change it is to use the powertoys util. Not sure if there is another
way.
Charles
On Mon, 6 Oct 2003 02:07:25 -0700, "ATong" <EMail@HideDomain.com> wrote:
>The icon used by system seems to be those 256-color icons.
>
>>-----Original Message-----
>>A VC.net application, the 3 16777216-color icons, 16*16,
>>32*32 and 48*48, have been modified, but after rebuild
>the
>>application, the icon does not change. Should we modify
>>anything else to change the icon?
>>.
>>
|
| |
|
| |
 |
| |
 |
Index ‹ DotNet ‹ Dotnet |
- Next
- 1
- 2
- 3
- Visual C#.Net >> Parameterized Query unexplainably slowHi,
I came across a very weird problem. I get a statement from a file, dump
the text into a sql command, add a sql parameter and run the query.
This lasts about 1 1/2 hours, compared to 2-3 minutes running the same
statement from within the sql query analyzer.
To get around this problem I added the following lines INTO the
statement file:
declare @param int
set @param = 20060411
using this, the statement lasts 2-3 minutes.
When using s sql parameter with the sql command the same statement
needs 1 1/2 hours. I added the parameter as follows:
cmd.Parameters.Add("@FromDate_SID", date.ToString(("yyyyMMdd")));
or
cmd.Parameters.Add("@FromDate_SID",
Convert.ToInt(date.ToString(("yyyyMMdd"))));
Both result in a duration of 1 1/2 hours.
Does anyone can give me a clue on this? I'm lost, and I am running out
of ideas.
Thanks in advance
Michael
- 4
- Microsoft Project >> Resource displayWould it be possible to display resources in different columns, depending on
the resource group?
Could I generate a report showing the different columns and tasks?
- 5
- Visual C#.Net >> accesing Form1:controls from other classHello
I have Form1 : System.Windows.Forms.Form and some public controls in it:
public System.Windows.Forms.ComboBox comboBox1;
public System.Windows.Forms.ComboBox comboBox2;
in the same project i have some other files with some otherclasses.
Can i access any of theese controls from that other classes ?
How ?
Thanx
- 6
- Visual C#.Net >> C # and C ++ learning curveHi Complete ass here trying to get his feet wet in .NET programming. I want
to start easy, understanding what is talked about. Which of these two would
be a better choice, if same, which one is consider easier to learn first?
Thanks for any advice
- 7
- Net Framework >> Delegates and InterfacesI have a dilemma that I'm having a tough time getting through on a VB
2005 issue. I have a custom control for a form to display data from a
windows form. Right now, the main form calls various web service
methods in order to update the data. Since the data to be displayed
depends on the call to the web service, I use a delegate that will
invoke the method when a timer elapses. Works good for now but I want
to create additional custom controls that will display data and have
the main form cycle through the controls. Because of this, I figured
that it would be easier to implement an interface on the custom
control so that the form can instantiate the controls dynamically as
it cycles through.
So here's my dilemma. The control (or controls) could call various
methods to get a "data refresh". Therefore, I wanted to give the
control the delegate to invoke within itself as the main form cycles
through each control on a separate timer. But how do I do that using
an interface? I can't have the delegate on the interface because its
a type. I can't pass in the signature to the c'tor because it's not a
type. What options do I have?
I appreciate any help anyone can give.
- 8
- ADO >> Sql Statement ErrorsHi Group,
Hope somebody could help? I have a table called ArcirisUsers which has a
field called SITES. I would like this field to pull a list of sites from the
Site feild in my SITES table. I have created the following SQL stement:
SELECT ArcirisUsers.Usersname, ArcirisUsers.POSID,
ArcirisUsers.POSAccess, ArcirisUsers.[Password], ArcirisUsers.LiveDate,
ArcirisUsers.BomID,
ArcirisUsers.BomAcc, ArcirisUsers.ArcirisUsersID,
Sites.[Site Name]
FROM ArcirisUsers INNER JOIN
Sites ON ArcirisUsers.PrimarySiteID = Sites.SitesID
However when I try and run this it comes back with a error saying "No Value
Given For One Or More Parameters"
When I try and create the above in my DataAdapter Wizard it comes back
telling me "Cannot Get DataScheme" Which I assume is because the SQL query
is
wrong?
Could anybody please Point me in the right Direction?
Regards
Si
- 9
- 10
- 11
- Microsoft Project >> Progress reportHI,
This should be pretty easy but I can't figure how to do it. I need a way to
create a report that shows the progress from a given status date...I need to
know what the remaining work is and what the remaining work should be a the
given point. I would like it in a table format, not the graphical
representation in the Gantt. Any suggestions?
- 12
- 13
- 14
- 15
- Net Framework >> Is there any predefined delegate with no argument?Hi,
I am looking for a predefined delegate which in form:
delegate void NoArgument();
It's quite useful than other delegate with argument, I found
MethodInvoker in WinForms, which defined in such form, but I don't
want to add WinForm reference all the time, since my code nothing
relative the WinForm.
The reason why I use no argument delegate is quite often is that it's
quite easy to access local variable if I use anonymous methods, which
may decrease the prerequest of declare a delegate with some argument
to pass in.
For example, when I try to access WinForm in thread safe way, I
defined a static function DoThreadSafe():
private static void DoThreadSafe(Control control,
MethodInvoker function)
{
if (function != null)
{
if (control.InvokeRequired)
{
control.Invoke(function);
}
else
{
function();
}
}
}
When I use it, I do not need any parameter to pass to the "function",
such as:
value = 123;
DoThreadSafe(progressBar1, delegate
{
progressBar1.Value = value;
});
It is really easy to access the variable which is accessible in
current scope. I found many such cases which treat the delegate just a
block of code to execute without any need of argument.
I think that it's better to treat void delegate with no argument as a
special, and predefined in dotnet framework, and may be more
convinient to declare and call in the future version of C#. Is there
any existing delegate in .net framework?
Regards,
|
|
|