|
Hi!
That's something you cannot do with a regular PictureBox . The PictureBox holds (and displays) a single image only.
To achive the effect you desire, you'll have to create your own control. This will have to have a collection of Image s and perform painting and handling of these images on its own.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Hi,
thanks for your reply! currently i'm using an ink picturebox control from the tablet sdk, which i can only do painting functions on. Do you have any links to any references which i can refer to, on creating my own controls?
|
|
|
|
|
There are plenty of articles here, why not just search[^] for them?
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
hi
i have some dll that i use it in my c# project.but i don't want that end user access to my dll.
i can add dll to my project and change emabedded resource property but how to use it ?
thanks ..
|
|
|
|
|
Yes you can although anyone with Reflector will be able to get it out.
The only way I can think of at the moment is to load the assembly using Reflection from a ResourceStream. See this[^] msdn page. However this will have added complications writing the application because it'll only be accessible during runtime and not at compile time.
A better solution if you can would be to simply (if you wrote the DLL) to included it in the source code of the program, it can even be linked in rather than copied so that you can build your dll if you want and also compile it inside the application.
|
|
|
|
|
Hello,
I'm trying to load an MHT file to a WebBrowser control from a stream. If I use the Navigate method, there's no problem. However, if I use the DocumentStream property it doesn't load correctly.
Is there any way to load it directly from a stream, without saving a temp file on disk?
I tried:
WebBrowser1.DocumentText = global::TestProject.MyResourceFile.MHTFileName;
But it's print the content of the file as if I opened it in Notepad
Thanks in advance for any help given.
|
|
|
|
|
I believe the WebBrowser initializes to content-type of text/html. Mht is a mime file so you would have to change the content-type. I don't know if this is possible through the interface. content-type is normally set either as a HTTP header or by the controls recognition of the file extension.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
If you do process.(whatever)
You get:
Paged Memory
NonPaged Memory
Paged System Memory
Virtual Memory
Private Memory
and maybe some other stuff, so which one is the processes current RAM usage? (careful now, i may not have listed it)
And what are these values in? Bytes? Bits (God forbid)!
|
|
|
|
|
Hello
If you want to know the RAM amount allocated to your process use Process.WorkingSet64 property
But remember that some larger applications use virtal memory and share other memory blocks with other processes.
Regards
|
|
|
|
|
I wondered what that was.
Well that's fine, thanks
|
|
|
|
|
Hello,
I am hosting my website with LunarPages who dont allow remote connection of SQL server. But I have developed my websites using local instance of SQL Express and kept mdf files in APP_DATA folder. So, I wanted a tool which can synchronize my local sql express mdf file with remote sql server. As SQL manager type software could do this things but they need to connect my remote sql server which is not allowed. I wanted to make a software by myself who can read a local .mdf file and generate SQL script (i.e. CREATE TABLE, INSERT INTO ) etc and communicate with an ASP.NET page and ASP.NET page will synchronize the SQL server database by executing the SQL query (CREATE TABLE....). Now Can you tell me which software or library can help me to generate sql create table / insert statements from local MDF file and at how can I read the SQL server database and get SQL statement again to build an mdf database in my local pc. In that way I can develop ASP.NET web application in my local pc with local mdf file with peace of mind. And at the same time if i can convert my remot sql server database to mdf file that will be a nie back up system for me.
Thanks
EMRAN
|
|
|
|
|
Have got a bit confuzzed reading the contributions on Reflection! My need is simple - I have a class in assembly 'myprog.exe' that has Constants for two strings representing the Version (e.g "xxxxx version 1.0") and an issue number nnn (e.g. "xxxxxx nnn yyyyyy"). During an update procedure, I need to check the values in the current installed version. I can load the current installed assembly 'myprog.exe' via the Registry, but don't understand how to pick up the two constants.
The Constructor for the class puts the constants in two 'easy access' variables. I update the two constants for each release.
Help please!
Pensioner Graham Dean
|
|
|
|
|
Hello
Graham Dean wrote: have a class in assembly 'myprog.exe' that has Constants for two strings representing the Version
Why?? Why not check the version of the assembly itself??
Graham Dean wrote: I can load the current installed assembly 'myprog.exe' via the Registry, but don't understand how to pick up the two constants.
Try this -Your constants must be public of course-:
using System.Reflection;
private void MyMethod()
{
Assembly MyAssembly = Assembly.LoadFile("MyFilePath.exe");
Type MyType = MyAssembly.GetType("MyClassName");
object MyOb = MyAssembly.CreateInstance(MyType.FullName);
if(((MyClassName)MyOb).ConstantA == MyValue)
{
//Do anything
}
}
Frankly I don't like the idea at all -no offense please -, yet I answered your question just the way you asked.
My opinion is to check the version of the assembly file itself. it's a lot easier, and won't make much difference -I think-
I hope the code is clear;) I haven't tested it, but it should work.
|
|
|
|
|
Thanks. I am new to .NET, hence my confusion - although programming since 1965! I perhaps should have used the file version, and will next time. Your clear answer has (I think) got me over the current hurdle!
Thanks again
Graham
Pensioner Graham Dean
|
|
|
|
|
Nearly there - but:
Assembly asm = Assembly.LoadFile(mrttexe);
Type TPInfo = asm.GetType("TProgInfo");
Object tpinfo = asm.CreateInstance(TPInfo.FullName);
string asmver = ((TProgInfo) tpinfo).MRTTVER;
Last fails to compile:
Error 1 Static member 'MRTT.TProgInfo.MRTTVER' cannot be accessed with an instance reference; qualify it with a type name instead
I have tried various combinations, including referencing the Class TProgInfo (as above) via the TProgInfo.cs file.
Pity the Internet wasn't around in 1965!
Pensioner Graham Dean
|
|
|
|
|
Hello again
Graham Dean wrote: although programming since 1965!
Wow!! I wasn't even born yet!!
Graham Dean wrote: Error 1 Static member 'MRTT.TProgInfo.MRTTVER' cannot be accessed with an instance reference; qualify it with a type name instead
Well the error message was clear, & I told you I haven't tested the code -Sorry. My mistake -, Yet everything has a solution.
All in it is that the code will change a bit, here is the new version:
using System.Reflection;
private void MyMethod()
{
Assembly MyAssembly = Assembly.LoadFile("MyFilePath.exe");
Type MyType = MyAssembly.GetType("MyClassName");
FieldInfo fi = T.GetField("ConstantA");
int Val = (int)fi.GetRawConstantValue();
if(Val == MyValue)
{
}
}
As you might have noticed that constant fields in C# are automatically considered as static members. So, you can't call them using instances. Here you will check the value using the name of the class itself, as shown above. Unlike last time, where we created an instance of the class.
I tested the code this time. & I Hope it won't disturb you anymore.
More regards
|
|
|
|
|
Nader and I had an 'off forum' discussion. I confused him further by revealing (a little late) that the constants were strings! Solution was to insert Properties in the Class to be reflected that return the strings then use code:
Assembly asm = Assembly.LoadFile(filename);
Type TPInfo = asm.GetType("MRTT.TProgInfo",true);
PropertyInfo pf = TPInfo.GetProperty("CONSTVER");
Object TI = asm.CreateInstance(TPInfo.FullName);
string constval = pf.GetValue(TI, null).ToString();
Thanks again Nader - works like a charm!
Pensioner Graham Dean
|
|
|
|
|
i have different textboxes in my from on one textbox when i press a tab key i want print one messagebox i am writing thiss code but its not working on tab key although its working on like back key but not on tabkey
plz tell me
Private Sub ItemCode_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ItemCode.KeyPress<br />
If (e.KeyChar = Microsoft.VisualBasic.ChrW(9)) Then<br />
MessageBox.Show("u have pressed tab key")<br />
<br />
End If
|
|
|
|
|
Hello
Is that Visual basic?? You're in the wrong forum. You should go to Visual Basic .Net forum[^]
A quick hint quoted from MSDN in the KeyPressEventArgs remarks:
"You cannot get or set the following keys:
The TAB key.
INSERT and DELETE.
HOME.
END.
PAGE UP and PAGE DOWN.
F1-F2.
ALT.
Arrow keys.
"
So if you want to catch the tab key, use the KeyUp event instead
Regards
|
|
|
|
|
in my setup project
i want my project to check if there exist .Net Framework or No if no instaul it automatic and then instaul my program
how can make this ?
Palestine
|
|
|
|
|
Hello
Follow these steps
1- Right click on the setup project's name in the solution explorer
2- Click on properties
3- Click on the prerequisites button
4- Check on "Create setup progra to install..."
5- Check on your prerequisites -according to your project's needs-
6- Cho0se "Download prerequisites from the same location as my application"
NB.
Please don't take any offense, but revise your english before posting
Regards
|
|
|
|
|
I would like to programatically add in a field to a crystal report at runtime. Does anyone know how I would do this? Thanks.
|
|
|
|
|
Can someone direct me to a good IRC client library in C#\.NET?
I've downloaded Meebey's library but it has alot of bugs and troubles.
If someone has a better one, please send me.
Thanks alot.
NaNg.
|
|
|
|
|
|
I just downloaded that...
Is there an informative article about that?
|
|
|
|