| Layout manager issue when docking panels? |
|
 |
Index ‹ DotNet ‹ Visual C#.Net
|
- Previous
- 1
- 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
- 2
- 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
- 3
- 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
- 4
- Winforms >> Cancel windows message from reaching parentI am developing a set of controls that must function inside of an application
that loads them through COM interop (I don't believe that makes a
difference). The application is designed to always handled the "Enter" key.
One of my controls is a text box which needs to allow the user multiline
input and not being able to use the "Enter" key is borderline unacceptable.
I have tried to override WndPRoc, PreProcessMessage, and a host of other
behaviors, but I cannot get the application to stop catching the enter
message.
I have written all messages to a text file when I transition using enter
versus using a mouse click, and I cannot even find a message that indicates
my control received an "Enter" at all.
All suggestions welcomed.
- 5
- Net Framework >> Serializable CollectionsIt seems that the only .NET Collection classes that are
serializable derive from Hashtable. I am planning on
remoting collections and wanted to use something more
like a CollectionBase. Any suggestions on how to do this
without a hashtable collection?
Thanks,
Mark Phillips
- 6
- ADO >> Connection Pool Time OutHi all,
I have the following scenario:
App1: Asp.Net Application that shows reports from some SQL DB
App2: Asp.Net WebService with two services exposed for clients, and a single
â??Checkerâ?? in the Application object that checks every some time (normally 2
or 3 minutes) for conditions in the same DB, and insert some values in it
using a transaction.
When the time spans completes, the checker retrieves via a SqlDataReader the
ready items and make the insertions as shown:
SqlDataReader reader = GetReadies();
try
{
// do something
// initialize the transaction â??transâ?? and the connection â??conâ??
try
{
// insert using the transaction
trans.Commit();
}
catch(Exception ex)
{
trans.Rollback();
throw ex;
}
finally
{
trans.Dispose();
con.Close();
}
}
finally
{
reader.Close();
}
In the web application I have few pages that get information from the DB,
and after a few retrievals, I got this error:
â??Timeout expired. The timeout period elapsed prior to obtaining a connection
from the pool. This may have occurred because all pooled connections were in
use and max pool size was reached.â??
So I review all code searching for unclosed datareaders or connections, for
nothing. I use SQLHelper in the web application and I always retrieve
datasets, anyway, I checked that all connections were closed.
Then I review the code in the webservice app, I think it is correct, isnâ??t it?
Even though I didnâ??t found unclosed connections, I started to watch the .Net
CLR Data performance object with the object Current # pooled connections. The
graph never goes over 7 connections; it oscillates between 5 and 8. I also
started a new trace in the SQLProfile to see if it audits logout events
occurs.
And still, after a while browsing in the asp.net application, I receive the
same error.
Note: the max pool size is set to 100 explicitly.
Any idea of the cause?
Thank you very much.
- 7
- ADO >> File format for a new application(I know it's a seond post, but I think I explain it better this way)
--
On my own I'm writting an application for the general public.
(a bit like word, except it has nothing to do with word ;-)
So far I used an embeded database engine to store the data (SQLite), I like
the concept because this way I could load/delete/updata whatever data I need
incrementally on demand. And I could also easily perform search.
What gets me more and more concerned is that creating a new (empty) file
(with just about 10 table, 30 index & triggers) takes up to 7 seconds!
Very bad user experience.
I'm considering my options and will gladly takes advice as I'm a bit daunted
by the work involve just to test.
- I was thinking to try an other embeded database engine, such as Firefox.
- I was thinking to use tar-gzipped serialized file (think XML serialization
should be better as it would be probably be better at version resistance
(but worst perf?)), but I was wondering about the wisdom of having all my
data in memory...
- any other ideas?
- 8
- Visual C#.Net >> Fade PictureBoxHi everyone I'm new to winforms from asp.net and I'm trying to fade in/out
an image in a picturebox on a winform. I'm doing research and I've found
things like opacity for the winform, but I haven't had any luck with a
picture box.
Can someone please point me in the right direction?
Thanks,
Ben
- 9
- 10
- 11
- 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.
- 12
- Winforms >> Unable to hide form? in .NET 2.0Any suggestions on how to make a form not visible when displayed via
Form1.ShowDialog() ?
If I put a button on the form called "Close" and in the click event I put
Me.visible = false, the form closes and my application terminates. I don't
want this, I just want it to hide (Me.Hide is the same as Me.visible).
I'm using a module1.vb with a sub Main() from the sub Main I Dim Form1 as
New myForm and then call the Form1.ShowDialog.
I can't find any way to hide a Form that is initially displayed (Modal) via
ShowDialog which closing the form. Is this just not possible in .NET 2.0
Rob.
- 13
- ADO >> Fun with products and Expression columnsI have somewhat of an interesting scenario:
The form allows the user to select a service, which populates a a grid of
product information related to that service ("service grid"). The user can
then select from the products in the first grid and those choices populate
the second "choices grid".
The product grid is bound to a strongly-typed dataset table which can be
filled in a couple of different ways. More on this shortly.
The choices datatable contains expression columns related to a product
table. So if the user choses Widget A, B, and C, the product prices and a
lot of other details for that service are reflected into the choices grid
without those values actually being duplicated into the choices table.
All of the structure works well technically. But there is a fundamental
concept decision to be made. That decision is in how to populate the
products table. At some future date, the product catalog may grow to be
50,000, 100,000 or even greater. My instinct is to individually populate the
products datatable with ONLY the Widgets that relate to Service1 when it is
selected, and then ONLY populate the widgets that releate to Service 2 when
it is selected (each service requires a subset of the entire product
catalog, thus limiting how big the product table may be).
Where this becomes problematic is that the user may need 2 or more Services.
So if they select products that relate to Service 1, Service 2, etc., then
the catalog to be displayed must grow much bigger. Displaying just one set
of products at a time will not work because this would cause a partial
display of the expression columns in the choices grid (since the
non-populated products still have a primary key back to the products table,
they display a row, but not the expression data).
The easiest answer would be to just populate the entire catalog in the
products grid. Of course, the easiest solution is the most expensive in
terms of database and processor resources. The next easiest answer would be
to populate the product grid with just one set of products at a time. But
this creates the above-mentioned issue with the expression columns.
The technical implementation is not an issue. I'm just looking for some
ideas or thoughts from anyone who has been down this road with multiple
grids and expression columns.
- 14
- Visual C#.Net >> Anonymous type etc. in C# 3.0I understand, basically, what this C# 3.0 code does, but I am unclear
on how it determines the data type of num and index in the lambda
expression in the following code. Nor can I see how it gets the array
index into the index parameter?
BTW: Is there a better forum for asking these questions?
public void Linq12() {
int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };
var numsInPlace = numbers.Select((num, index) => new {Num = num,
InPlace = (num == index)});
Console.WriteLine("Number: In-place?");
foreach (var n in numsInPlace) {
Console.WriteLine("{0}: {1}", n.Num, n.InPlace);
}
}
- 15
- Net Framework >> SQL - all users access db using same username - what licence required ?Hello,
I have an aspx app using 2005 express and need to upgrade to standard
edition to get the features i require.
My initial thinking was a single processor licence for 2005 standard edition
as you get unlimited user connections.
The app is designed so that no matter how many users connect to the website
they always execute with the same username via stored procedures to SELECT /
INSERT data (user authentication is handled by app).
If this is the case do i just need a single user for SQL server standard
edition ?
I will easily have 2 - 10 users connecting per second to INSERT or SELECT
data by running a stored procedure then disconnecting again. At the moment
all users execute using same login passed by the app to the sp that has the
appropriate rights.
Im not sure that spending £3000 on a single cpu licence would be the correct
way forward.
I understand that if you need 25-30 users that a single cpu licence would be
more economic.
Thanks for your time and any help.
Scott
|
| Author |
Message |
chiefjay

|
Posted: Wed Oct 29 00:42:57 CST 2003 |
Top |
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?
DotNet144
|
| |
|
| |
 |
Noah

|
Posted: Wed Oct 29 00:42:57 CST 2003 |
Top |
Visual C#.Net >> Layout manager issue when docking panels?
This is typically due to the Z-ordering of the controls on the form. The
Z-order effects which controls are "on top" of other controls (the 3D
dimension to 2D graphics). You can right-click on a control (such as the
panel) and use the "Bring to Front" and "Send to Back" to change the
Z-ordering of a control.
Actually, when repeating the operation you describe below, I could not
reproduce the exact results with VS.NET 2003. But hopefully the above
mentioned Z-ordering will help if this occurs in the future.
Cheers,
-Noah Coad
Microsoft MVP & MCP
"Kerry Sanders" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> 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?
>
|
| |
|
| |
 |
Lawrence

|
Posted: Wed Oct 29 09:37:04 CST 2003 |
Top |
Visual C#.Net >> Layout manager issue when docking panels?
Actually it is a bug in VS.Net 2002 that was fixed in VS.Net 2003
It invloves the order that you are adding the panels to the form
You need to drop the panel that you want to Dock=Fill first
Set Dock=Fill
then you can drop the panel that you want to Dock=Top next
Set Dock =Top
"Noah Coad [MCP & MVP]" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> This is typically due to the Z-ordering of the controls on the form. The
> Z-order effects which controls are "on top" of other controls (the 3D
> dimension to 2D graphics). You can right-click on a control (such as the
> panel) and use the "Bring to Front" and "Send to Back" to change the
> Z-ordering of a control.
>
> Actually, when repeating the operation you describe below, I could not
> reproduce the exact results with VS.NET 2003. But hopefully the above
> mentioned Z-ordering will help if this occurs in the future.
>
> Cheers,
>
> -Noah Coad
> Microsoft MVP & MCP
>
> "Kerry Sanders" <EMail@HideDomain.com> wrote in message
> news:EMail@HideDomain.com...
> > 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?
> >
>
>
|
| |
|
| |
 |
Kerry

|
Posted: Wed Oct 29 10:17:57 CST 2003 |
Top |
Visual C#.Net >> Layout manager issue when docking panels?
Thanks for the replies everyone. I am not sure if the
issue has been fixed, because I definited duplicated it
yesterday in .Net 2003 as have others in our office.
Anyway, thanks for the tip on the order in which the
panels should be dropped. Much appreciated!
>-----Original Message-----
>Actually it is a bug in VS.Net 2002 that was fixed in
VS.Net 2003
>
>It invloves the order that you are adding the panels to
the form
>You need to drop the panel that you want to Dock=Fill
first
>Set Dock=Fill
>then you can drop the panel that you want to Dock=Top
next
>Set Dock =Top
|
| |
|
| |
 |
Kerry

|
Posted: Thu Oct 30 01:42:47 CST 2003 |
Top |
Visual C#.Net >> Layout manager issue when docking panels?
>It invloves the order that you are adding the panels to the form
>You need to drop the panel that you want to Dock=Fill first
>Set Dock=Fill
>then you can drop the panel that you want to Dock=Top next
>Set Dock =Top
I just how had a chance to try this out. This tip worked perfectly. Thanks
again.
|
| |
|
| |
 |
| |
 |
Index ‹ DotNet ‹ Visual C#.Net |
- Next
- 1
- 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?
- 2
- 3
- 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,
- 4
- 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.
- 5
- 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?
- 6
- 7
- 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
- 8
- 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
- 9
- 10
- 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
- 11
- 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
- 12
- 13
- 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!!
- 14
- Dotnet >> Can not change application iconA 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?
- 15
|
|
|