|
The windows forms will behave abnormally when you try to access them forom a different thread then they are, and as you are probably getting the communication message on another thread you cannot directly control the forms
BUT!
the .net developers have been kind enough to porvide us with the 'Invoke' method, which is a member of each and every control (forms, buttons etc.)
this allows you to tell the control (form for this matter) to do something in it's own thread
what you need to do is to create a method (sub) that creates the new form and assigns it to a variable, that method should be located in your startup form, or any other form you want to use.
<br />
private AdminFormMember as AdminForm<br />
<br />
Private Sub CreateNewForm() <br />
AdminFormMember= New SocketControlForm()<br />
<br />
AdminFormMember.Show()<br />
End Function<br />
and Create a delegate to it like so
<br />
private delegate sub CreateNewFormDlg()<br />
and call it from your code when you want to create to new form using the 'Invoke' method, like so:
<br />
If (OpenAdminForm = True) then<br />
' Creating a delegate instance<br />
dim CreationDelegate as new CreateNewFormDlg()<br />
' invoking it from the main form's thread !<br />
MainForm.Invoke(CreationDelegate)<br />
<br />
end if
That's it, not too complicated and it works, trust me
Fade (Amit BS)
|
|
|
|
|
Hi!
Does anybody know how to get local time for arbitrary location?
The OS surely has ability to calculate it, but I can't find how to use it.
If I only could create a TimeZone object for any given location... But I can't.
So is there another way to get what I want?
|
|
|
|
|
Is there anyway this can be done?? I know that u cant set the backcolor to transparent because he doesn't support it. But it there a way around to do this?
|
|
|
|
|
See the SetStyle method. Pass the ControlStyle.SupportsTransparentBackColor to the method. This allows you to set backcolor to Color.Transparent
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
i have a small .net class i wrote that is simply a "com wrapper" to access the fileopendialog.
i am using it for an application that have jscript as an embedded scripting engine.
on my machine i had to use regasm xxx.dll from the dll directory to get it to work - this is fine
however i CANNOT get this to work on any other machine.
i have:
installed the .net framework on the client machines
tried running the .reg file resultant from regasm xxx.dll /regfile on the machines
tried running regasm xxx.dll as i did on my machine
|
|
|
|
|
i figured out that i also needed to run regsvr32 /n xx.dll on it.
|
|
|
|
|
Does anyone know of an IE Toolbar written for .NET?
|
|
|
|
|
Good day all…
I am experiencing a problem in using the Form Icon property. I have created a custom icon for my app and cannot display the icon (in the design view) by setting the property using the browse function. It displays properly in the properties view but not on the title bar. I get a default icon (on the title bar) of which I cannot determine its origin. This icon is not the system default icon.
Thank you very much in advance for your assistance
Have a great coding day.
Regards,
Tony D. Abel
|
|
|
|
|
Hi there -
following problem:
i programmed a udp server, that sends serveral udp packets by broadcast in a while loop.
my udp clients take this packets asynchronously.
unfortunately, my server is much faster than the clients, so it sends more udp packets that could be accepted by the clients. i developed a kind of speed synchronysation between server and clients, but anyway it does not guarantees that at some times, there are too many udp packets for the clients to handle. so my guess, the udp packets are stored in kind of buffer on the windows client systems. but that's what i do not want. but i have no idea to either tell the client pc to drop udp packets that are older then e.g. 1 second nor do i know how to tell a udp packet not to be stored in a buffer.
can anyone give me a hint?
thanks.
tom
|
|
|
|
|
Hi
i use this code to retrieve my image field from sql server
(my file isn't picture !!!)
***********
Dim MyData() As Byte
MyData = Ds.Tables(mytable).Rows(0).Item(myfield) 'For Example
Dim K As Long
K = UBound(MyData)
Dim fs As New FileStream("c:\mkh.xml", FileMode.OpenOrCreate, FileAccess.Write) 'in this line get error
fs.Write(MyData, 0, K)
fs.Close()
fs = Nothing
Ds = Nothing
************
but it doesn't work and give me this error in ASP.Net(With Vb)
<<access to="" the="" path="" "c:\mkh.xml"="" is="" denied.="">>
i get this code from microsoft msdn and alot of furoms !!!!
then why doesn't work??
MkhProgrammer
|
|
|
|
|
Hello,
This shouldn't be hard, but I can't seem to figure it out. I have a simple setup project created using vs.net "Setup and Deployment Projects". I added a single dialog to the default UI with 4 text boxes. The property names associated with the text boxes are EDITA1, EDITA2, ...etc.
I build the project and then attempt to modify the default value of EDITA1 from the command line by entering the following:
msiexec /i Setup1.msi EDITA1="My Val"
This runs setup, however the text box associated with this property comes up empty. I'm expecting that "My Val" would appear in the text box.
What am I missing?
Thanks,
-saed
|
|
|
|
|
Hi
can anybody tell me:
how can i make an exe file that get <<cmd parameters="">>?(like c:\myexefile.exe -p1 -p2 ...)
Best Regards
MkhProgrammer
|
|
|
|
|
|
Hi
can i change caption of msgbox buttons?
for example instead of ok i want use "Trust" !!!
Best Regards
MkhProgrammer
|
|
|
|
|
Hi
can anybody tell me that:
1)How can i retrieve a binary field (image field) that stored in SqlServer2000 with Vb.Net and save
it again in my hard disk that i have again that file?
2)can SqlServer itself convert image field to file with its store procedures?
3)can sqlserver run an exe file on local computer from its storeprocedure?
Best Regards
MkhProgrammer
|
|
|
|
|
Hi Evrybody,
I got A question for you all.
At some point in my project i want to automate the creation of my application.There are three source files which need to be processed to create the finished program.
How do i create a batch file which will compile the programs to build the required assemblies and the executable.
i know it has got something to do with nmake command.Can somebody please explain me this command and the procedure.
Thank you
Ankit
|
|
|
|
|
Hi all
I've read in some articles on the web about a new
scripting language called VBscript.net ,
I checked Microsoft web site but they say nothing about it
and actually no body are talking about it clear enough
, so anyone knows what is it?
and what is it for and how can we work on it
-what IDE?- and support stuff about it
& thank u
Z BASSEL
|
|
|
|
|
Greetings!
I have a custom class that has three public properties. I have a control that has a public property that is an instance of that class. I want the property to show up in the property grid with a + sign and to show the class's properties when a user clicks on the + sign.
Fine. No problem. I just set the TypeConverter attribute for the class to ExpandableObjectConverter, and everything works as advertised.
With one small exception.
I have a demo project that has a form that has an instance of the control. I edit the form and set one of the control's class instance's properties. I run the form and click a button that shows what the object's properties are. The message box tells me that the value I entered in the property grid got lost!!! It is not permanently applied to the object on my form!
What do I have to do to get .Net to remember my property change?
Thanks very much!
Rob Richardson
|
|
|
|
|
Hi,
Problems with version 1.1.4322....
I have used this tip How To Repair IIS Mapping After You Remove and Reinstall IIS(http://support.microsoft.com/default.aspx?scid=kb;en-us;306005)
The information is above is not helping because untill now after many
attempts this did not function yet!
Take a look at:
first:
%windir%\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe -i
second:
regsvr32 %windir%\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll
I have good messages that is OK, but untill I could not run ASPNET and nor
WEBService applications under VS.Net 2003/Windows 2000 server com SP 4/IIS
5.0 !
What shoud I do?
Thanks,
Vilmar Brazão de Oliveira
=========================
Vilmar Brazão de Oliveira
|
|
|
|
|
Hi, I fixed the problem pointing the new project to virtual folder created
at IIS Server!
thanks,
=========================
Vilmar Brazão de Oliveira
|
|
|
|
|
Hello there experts!
Im currently working on my first .Net application where i visualize some FEM calculations using VTK(visualiztion ToolKit).
Im using .Net and WINAPI as GUI.
But now I want to build an standalone application and really dont have any ideas on how to do this. So I dont really know what to look for on the web.
I have build an version by setting the build mode to Execute, and I guess that this version requires the dll files if it was to run on another computer? If that is the case I want to make an install/uninstall application that installs these files. Any suggestions?
And finally , if I dont want to use dlls, how do I build an static version ?
Regards
Peter
|
|
|
|
|
Ibana wrote:
And finally , if I dont want to use dlls, how do I build an static version ?
You cannot, you must deploy the .NET framework on the target machine.
Ibana wrote:
But now I want to build an standalone application and really dont have any ideas on how to do this.
You probably want to create a new Windows Application project (also know as a WinForms or Windows Forms application - if your looking for key words). You'll find the relevant type in the project type folder for your language of choice. Also there are a number of tutorials here on CodeProject for getting started.
Ibana wrote:
If that is the case I want to make an install/uninstall application that installs these files. Any suggestions?
You should add a Setup Project (in the Setup and Deployment Project category) to your solution. There are some tutorials on MSDN to help you get started with creating a setup project.
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
Hi, anyone know if there is a tool to search for date/time/wildcards within Visual sourcesafe?
As i tried the vssreporter.exe which is a nice tool. But its lacking of wildcard search. Im looking for a tool which can work with sourcesafe or does sourcesafe has such funcitonality??
|
|
|
|
|
I am building a custom Print Dialog box in VB.net that works similar to Microsoft Word Print Dialog box.
I have problem with these two features –
1. Printer Properties – When user clicks on this button a “Printer Properties” Dialog should be shown similar to what you get from here – ControlPanel >> Printers and Faxes
Right click on any Printer and in the pop up menu select “Printing Preferences” (For XP OS)
(Similar to dialog that opens when you click on “Properties” on the Print dialog of a Word or Excel Application)
I am using the API call to PrinterPropoerties in winSpool.drv, but this give a different Dialog than what I want.
2. Find printer – when user clicks on this button a “Find Printer” Dialog should be shown similar to what you get from here – Startup >> Search >>Printers, computers or people .. >>A printer on the network (On XP os)
(Similar to dialog that opens when you click on “Find Printer” on the Print dialog of a Word or Excel Application)
I am just not able to get these working.
I will appreciate, if any one can help me in solving the problem.
|
|
|
|
|
Hi
I want to save The Text of a MultiLine TextBox into the DataBase alongwith paragraph breaks.And retrieve the same.
How can I do it.
Thanks in anticipation
g
|
|
|
|