|
codeweenie wrote:
Can you explain to me what I need to kill in my code or what is being referenced that would be causing it to be huge?
If its a WInForms app, pretty much nothing. They tend to take about 20mb. A console app, about 10mb.
The referenced assemblies are the ones in the solution explorer under your project, remove the ones you dont need. All assemblies are optional, except for the core assemblies, but those you cant change.
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
Does anyone have some neat trick to make a form not to steal focus from another form??
what i want to do is to create a popup window that does not steal focus from the form that opens it...
ive tried to mess with the wndproc , created my own real subclasser using setwindowlong (incase the winforms wndproc didnt get all messages)
ive tried various window styles...
and nothing works...
the closest i got was to send a wm_ncactivate to the parent form when the popup form recived focus..
but thats not a very clean way to solve it...
//Roger
|
|
|
|
|
Cannot remember for sure, but I think a tool window does not take the focus.
I know it is a pain in the lower sections to deal with. Would have been nice if Microsoft provided a simple window style for this where it can be on the outside of the window client area and still not take focus. A few months ago I spent a lot of time trying to figure an easy way around this to build drop down grid combo where it would appear like a combo box but when you dropped it, a grid would appear. Got tied of it always stealing focus. Tried many different things, all the way to have the desktop be the parent but still no go.
Good luck, it wore me out Would be nice if you found a way that you could drop me a note, still would like to build that drop down grid combo
Rocky Moore <><
|
|
|
|
|
oke , this didnt solve the problem.
anyone else have some idea??
//Roger
|
|
|
|
|
I'm looking for this too, I have a custom control, which looks like combo box, (using uxtheme.dll to drawn the combobox button, seperate textbox, and a listbox to have a color picker, vs.net style) and it works bloody well, all ownerdrawn. But the listbox is on a form, that pops up like a combobox dropdown, would be nice it it was a non-focus form as well
|
|
|
|
|
Hi
any ideas how to DRAW something with xp style?
say eg a button , if i would like to draw a xp styled button on a graphics surface,
is there any neat xp api one could use?
//Roger
|
|
|
|
|
I think version 1.1 of the framework includes an property by the name "Visual Styles" which would help you achieve the winxp look and feel.
If you are talking about win32 api which you can use through p/invoke, then there are some 30+ functions which deals with themes alone.
Maybe you can start with something like "DrawThemeBackground" or "DrawThemeEdge", you can get more info' from msdn on these functions.
Hope this helps.
Cheers,
Kannan
|
|
|
|
|
Thanks ,
i will read some on the xp theme drawing api..
(had no idea there was such apis...)
//Roger
|
|
|
|
|
Have anyone seen data object broker like ObjectRelationalBridge
written in managed code for .NET?
(db.apache.org/ojb).
/Mario
PS.
I did not find any forum this question might fit, please excuse me if this is completely incorrect forum for this question!
DS.
|
|
|
|
|
THONA Consulting is creating EntityBroker for .NET. I tried using an early beta of it but couldn't get it to work correctly because they did their work in Everett where I was working with VS.NET 2002. I think they've done some work regarding the 2003 -> 2002 stuff so it is more usable (including a .config file so the correct assemblies are loaded).
http://www.thona-consulting.com/content/products/entitybroker.aspx[^]
James
"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation
|
|
|
|
|
The question is: If I have 2 Forms in my project and Form1 have to pass some arguments to Form2. Lets say that Form1 reading file to TextBox and I wnat Form2 to show progress of reading by adding values to the progressBar (on Form2) - so how I can pass values to another Form ? May be I even can change label.Text on another Form ?
[Sorry - my english is bad but I do my best]
|
|
|
|
|
sure! you can )
just make some public properties on form2 or (easier) make controls on form2 public.
To make controls public, just change "modifiers" property to <public> on property pages in VStudio.
I hope, it helped you
h.
|
|
|
|
|
Hi all,
How can we indent the text in a richtextbox control ?
Bulletindent property defines indent for bullets.
But how can i further indent a text which is already bulletted?
How can we add numbered bullets to a text in a textbox control ?
Thanks
Smitha
The future belongs to those who believe in the beauty of their dreams.
--Eleanor Roosevelt
|
|
|
|
|
Hello,
I got a program whith PrintPreviewControl, on Win-
2000/XP workstation all fine, but on Win-98 workstation
PrintPreviewControl periodically have the following error:
====================
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set
to an instance of an object.
at
System.Windows.Forms.PrintPreviewControl.CalculatePageInfo
()
at
System.Windows.Forms.Control.InvokeMarshaledCallbacks()
====================
This error also occurs in this MS Example:
http://msdn.microsoft.com/msdnmag/issues/03/02/PrintinginN
ET/default.aspx
Any ideas? I really need to resolve this problem.
Thanks.
|
|
|
|
|
Hey all,
I'm working on an Active Directory web application. I've gotten further than my prior post - if you read my prior post, basically, the problem is this - I have to bind to the LDAP directory as a specific DN to authenticate (the username/password route for AD is not good enough since we are dealing with a non-MS ldap server).
The process is this:
* bind as an anonymous user
* search with a filter of your own devising
* obtain a single directoryentry object
* bind to this directoryentry with the provided password
This seemed like an easy thing to do initially - after all, we do have System.DirectoryServices --- the actual process was a little more involved.
I've done the first three and got them working now (see below for the code). I'm now at step 4 - how do I bind to the directory using an existing DirectoryEntry and a password? My first thought was:
DirectoryEntry bound = new DirectoryEntry(me.Path, "", password, AuthenticationTypes.ServerBind);
... but that does not seem to work (i.e. it always returns) - how can I tell if the binding was successful?
Code to get to this point:
<br />
string path = _host + "/" + _basedn;<br />
DirectoryEntry entry = new DirectoryEntry(path);<br />
Regex r = new Regex(Regex.Escape("$(login)"));<br />
string filter = r.Replace(_filter, username);<br />
DirectorySearcher dsrch = new DirectorySearcher(entry);<br />
dsrch.Filter = filter;<br />
dsrch.SizeLimit = 2;<br />
SearchResultCollection results = dsrch.FindAll();<br />
if (results.Count == 0) return false;<br />
if (results.Count > 1) throw new Exception("Invalid user ID in LDAP Directory");<br />
DirectoryEntry me = results[0].GetDirectoryEntry();<br />
-Adrian
|
|
|
|
|
See if you can repeat this or actually help me solve this problem I'm having.
1) Install DirectX 9.0 C# edition.
2) Create a new project.
3) Add a component or a control to this project.
4) Drag the component/control onto your form and confirm everything is working fine. Delete it once it works.
Now...
5) Add a reference to 'Microsoft.DirectX'
6) Drag the same component/control onto your form and confirm that you get a error message 0x80131019.
7) Delete the reference to 'Microsoft.DirectX'
8) Drag the same component/control back onto your form and confirm that everything is fine.
BTW: If you were to run the application with the component/control and the reference to DirectX, everything works fine.
Any thoughts?
|
|
|
|
|
I am having trouble with this compiling.
The compiler says that invalid array initializer.
<br />
int i1 = 12;<br />
byte[][] bs1 = new byte[][(uint)dnsQuestions.Count];<br />
for (int j1 = 0; j1 < dnsQuestions.Count; j1++)<br />
{<br />
bs1[j1] = ((DnsQuestion)dnsQuestions[j1]).ToByteArray();<br />
i1 += (int)bs1[j1].Length;<br />
}<br />
byte[][] bs2 = new byte[][(uint)answerResourceRecords.Count];<br />
for (int k1 = 0; k1 < answerResourceRecords.Count; k1++)<br />
{<br />
bs2[k1] = ((ResourceRecord)answerResourceRecords[k1]).ToByteArray();<br />
i1 += (int)bs2[k1].Length;<br />
}<br />
byte[][] bs3 = new byte[][(uint)authorityResourceRecords.Count];<br />
for (int i2 = 0; i2 < authorityResourceRecords.Count; i2++)<br />
{<br />
bs3[i2] = ((ResourceRecord)authorityResourceRecords[i2]).ToByteArray();<br />
i1 += (int)bs3[i2].Length;<br />
}<br />
byte[][] bs4 = new byte[][(uint)additionalResourceRecords.Count];<br />
for (int j2 = 0; j2 < additionalResourceRecords.Count; j2++)<br />
{<br />
bs4[j2] = ((ResourceRecord)additionalResourceRecords[j2]).ToByteArray();<br />
i1 += (int)bs4[j2].Length;<br />
}<br />
byte[] bs5 = new byte[(uint)i1];<br />
BinaryWriter binaryWriter = new BinaryWriter(new MemoryStream(bs5));<br />
try<br />
{<br />
BigEndian.Write(binaryWriter, identifier);<br />
BigEndian.Write(binaryWriter, (ushort)flags.Data);<br />
BigEndian.Write(binaryWriter, (ushort)dnsQuestions.Count);<br />
BigEndian.Write(binaryWriter, (ushort)answerResourceRecords.Count);<br />
BigEndian.Write(binaryWriter, (ushort)authorityResourceRecords.Count);<br />
BigEndian.Write(binaryWriter, (ushort)additionalResourceRecords.Count);<br />
for (int k2 = 0; k2 < (int)bs1.Length; k2++)<br />
{<br />
binaryWriter.Write(bs1[k2]);<br />
}<br />
for (int i3 = 0; i3 < (int)bs2.Length; i3++)<br />
{<br />
binaryWriter.Write(bs2[i3]);<br />
}<br />
for (int j3 = 0; j3 < (int)bs3.Length; j3++)<br />
{<br />
binaryWriter.Write(bs3[j3]);<br />
}<br />
for (int k3 = 0; k3 < (int)bs4.Length; k3++)<br />
{<br />
binaryWriter.Write(bs4[k3]);<br />
}<br />
}<br />
finally<br />
{<br />
if (binaryWriter != null)<br />
{<br />
binaryWriter.Close();<br />
binaryWriter = null;<br />
}<br />
}<br />
return bs5;
Any help would make my year.
Thanks
Bo Hunter
|
|
|
|
|
Replace all occurences of [][(uint)dnsQuestions.Count] with [(uint)dnsQuestions.Count][].
|
|
|
|
|
Bo,
I can see two mistakes:
(1) referring to '7.5.10.2 Array creation expressions' in the C# online reference you cannot instantiate the sub-arrays, because the initial value of the first array is null. But in any case this would be an array of new byte [count] []. You try to create a subarray, where no array is created and initiated: new byte [][count] <- this can never work, because the compiler doesn't know how many sub-arrays (i.e. memory) must be initiated.
(2) don't cast to uint, use System.Convert.ToUInt32.
Hope this makes your year
Wolfgang
|
|
|
|
|
So how do I instantiate this?
<br />
<br />
byte[][] bs1 = new byte[(uint)dnsQuestions.Count][];<br />
<br />
for (int j1 = 0; j1 < dnsQuestions.Count; j1++)<br />
{<br />
bs1[j1] = ((DnsQuestion)dnsQuestions[j1]).ToByteArray();<br />
i1 += (int)bs1[j1].Length;<br />
}<br />
<br />
Then how do I instatiate the other part of the array?
<br />
<br />
byte[][] bs1 = new byte[dnsQuestions.Count][dnsQuestions.Count];<br />
<br />
for (int j1 = 0; j1 < dnsQuestions.Count; j1++)<br />
{<br />
bs1[j1] = ((DnsQuestion)dnsQuestions[j1]).ToByteArray();<br />
i1 += (int)bs1[j1].Length;<br />
}<br />
<br />
Like this and IntelliSense says this is wrong.
Thank You
Bo Hunter
|
|
|
|
|
If anyone is willing to take a look at this
project I would be greatfull.
It is Dns query class library with a test app
as well. It runs but I get the Server Faliure
message.
Thanks Again
Bo Hunter
|
|
|
|
|
Hi,
Can anyone tell me how to change column name and column width for a DataGrid (Windows.Forms) that is not bound to a DataSet (i.e. not using DataGrid.TableStyles?)
Thanks in Advance,
[EDIT]
Actually, I just figured out how to edit the names by accessing my DataTable, and figured out how to create a TableStyle dynamically:
DataGridTableStyle myGridTableStyle = new DataGridTableStyle();
However, Help, says you must first create a new DataGridColumnStyle per the table. This:
DataGridColumnStyle myGridColumnStyle = new DataGridColumnStyle();
isn't available, though. Compiler error:
Cannot create an instance of the abstract class or interface 'System.Windows.Forms.DataGridColumnStyle'
So, anyone know how to get around this? I know I have to use DataGridColumnStyle's to change the width of the column, but if I can't create a DataGridColumnStyle I'm at a loss...(And like I said in the original post: no, I can't use the GUI to accomplish this because I'm not using a DataSource via DataSet, etc.)
[/EDIT]
-Idealius
|
|
|
|
|
The DataGridColumnStyle class has over 10 abstract methods, thus cannot be instantiated. The compiler lists the methods that need implementation.
Either you provide (default) implementation, or you may just as well use one of the two ready-to-use derived classes. In MSDN, click on the DataGridColumnStyle item in the TOC, you'll see the class hierarchy, which lists : DataGridBoolColumn and DataGridTextBoxColumn.
|
|
|
|
|
Hi everybody!
I've written a database application ... the database file is a mdb file and the provider is Jet 4.0 OleDB Provider ... the app was fully functional on my pc but when I moved it on another machine that only had .NET Framework it didn't work! A message Box appears with this error:
------------------------------------------
Common language runtime debugging services
Application has generated an exception that couldn't be handled
Process id = 0x.... (-1...), Thread id = 0x.... (-1....)
Click ok to terminate the application
Click cancel to debug the application
--------------------------------
When I fully install the visual studio .net the app works perfectly again! It seems it lacks something when there's only framework installed!
What should I do???
Best regards!
|
|
|
|
|
Make sure to provide the MDAC redistribuable[^] as well.
If you use a particular .NET driver, you might also have to redistribute the corresponding assemblies. If you are using .NET 1.0, more info here[^] (ODBC .NET data provider). Those drivers are now part of the .NET 1.1 run-time (but it's still in beta).
|
|
|
|