|
I agree. I've noticed his code has a fixed bitmap size and have wondered if he should set the bitmap depending on the text size (unless he's forced with a 170x200 image)...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hi all,
A problem takes me back once again to the code project.
Right now I'm working on a small project in which I would like to generate my buttons, textfields etc dynamicly (I have an xml file and when it encouters < control type= button name = btn1/> it creates a button called btn1 and its added to the page (its possible to set the size etc.)
The reason why I'm doing this is that from time to time you just want to add a simple button but don't feel like recompiling the whole project or a client wants an extra button/image and would like to add it himself.... (with some sort of wizard typed thing)
this is all working. buttons and controls are created without a problem. I can retrieve info from my textboxes etc no problem. But well lets say I want to create a button but it needs a new "function" while clicking on it so I would need to add a handler to the button but I don't know what the code is going to be so I added in my xml file: <control type= button name = btn1 handler= btn1_handler/>
This function is then coded in an external file (simple notepad for exemple)
now where I dont really know how to do it is associate this function btn1_handler with my btn1 so that it handles an onclick event... the whole thing without recompiling but using for example vbscript or ICodeCompiler.....
Would this be possible to do? or? because well I dont know what will be in the function nor which button it corresponds to except in my xml file....
any help would be greatly appreciated
Cheers
jozef
its our widgets that make us men
|
|
|
|
|
It's possible. I don't exactly know how, but it is.
I'm figuring that you would have to load the button handler text into a CodeDom and compiler it into an in-memory assembly. This assembly would then have to be loaded into the AppDomain, kind of like plugin functionality. You'd then have to wire up the event handler yourself after the code is loaded.
Don't ask for example on this one for I don't have any. This is all just speculation. I've given you enough keywords to Google on to get the smaller parts of the problem solved though. After that, it's a matter of stringing those smaller solutions together to get this to work.
|
|
|
|
|
Okay, thanks alot, I think I will find a way with the different info you have given me and its good to know it's possible to avoid searching the internet for days and finally realising it isn't possible
Thanks again, and well if I find it I'll be sure to share it in here
Cheers
jozef
-- modified at 12:15 Thursday 28th June, 2007
its our widgets that make us men
|
|
|
|
|
Hi,
If I have a dataset with a couple tables, is it possible to take one of these tables and copy it over to another dataset? I just want one table in my dataset.
Regards
ma se
|
|
|
|
|
use clone - copy the structure
you can either copy the rows manually or use writexml/readxml to transfer the rows.
|
|
|
|
|
Hi,
My XML format looks like this:
<?xml version="1.0" encoding="utf-8"?>
<Products>
<Product>
<ID>5555</ID>
<ProductName>My Product</ProductName>
<Price>50</Price>
</Product>
</Products>
I need to know how to get this into a dataset, then I will have more control of the data. I know there is a function that saves the XML into a datast, but how does it know that I want the fields in the <Product></Product> hierarchy?
Or how should this be done?? I just want the <ID>, <ProductName> and <Price> to be the column names, and the values in tags the values of the fields in the row.
Regards
Brendan
|
|
|
|
|
It looks like you have the right structure to just to a ds.ReadXml("c:\temp\filename.xml")
So <Products> would be your dataset
You table would be <Product>
so multiple rows would look like:
<Products>
<Product>
<ID>5555</ID>
<ProductName>My Product</ProductName>
<Price>50</Price>
</Product>
<Product>
<ID>6666</ID>
<ProductName>My Product2</ProductName>
<Price>60</Price>
</Product>
</Products>
So I don't think you will have to do much to get this working.
Ben
|
|
|
|
|
How can i backup the database from SQL server 2000 from my application using vb2005
plz this us urgent
thanks
|
|
|
|
|
Execute the BACKUP DATABASE Statement from the FrontEnd
The name is Sandeep
|
|
|
|
|
Just to expand, the syntax is
BACKUP DATABASE myDatabase
TO DISK = 'c:\backup\myDatabase.bak'
|
|
|
|
|
thanks for u reply but i don't get it
would u plz give me example ??
|
|
|
|
|
Didn't you see the Syntax above? Just try with it and see.
The name is Sandeep
|
|
|
|
|
i saw it
but here what i typed
If cn.State = ConnectionState.Closed Then<br />
cn.ConnectionString = "provider=SQLOLEDB;server=maged;database=ceasr;user id=sa;pwd=magedhv"<br />
cn.Open()<br />
cmd.Connection = cn<br />
cmd.CommandType = CommandType.Text<br />
cmd.CommandText = "BACKUP DATABASE ceasr to disk = d:\backup\myDatabase.bak"<br />
End If
but it didn't worked
|
|
|
|
|
See this posting I made previously [^]
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
i want to override a button property?is it possible? how can i delete a existing property from a button
|
|
|
|
|
dear anujose,
you can add the code like this
btn.attributes.add("OnMouseOver",someCode())
All The Best
Sathesh Pandian
|
|
|
|
|
i want to override a button property in winform not an event
|
|
|
|
|
Would you not have to inherit the button control into your own class and expand on it from there?
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
You'd have to create your own Button class and override the property. To make the Text property disappear and have the Text on the button be forced to something:
Imports System.ComponentModel
Public Class MyButton
Inherits System.Windows.Forms.Button
<Browsable(False)> _
Public Overrides Property Text() As String
Get
Return "This is my custom button!"
End Get
Set(ByVal value As String)
' Just don't do anything with this
End Set
End Property
End Class
|
|
|
|
|
i want to make a size property with a + .when i click in + i want to open height and width property.how can i do this?...........
|
|
|
|
|
You need a new Class called size with properties for X and Y etc.
Then on your control create a property to type Size
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
In addition to what Steve said, if you want to learn a bit about custom property editors, take a look at this[^] article.
|
|
|
|
|
i would like to make form contain textbox
required:
i would like the user after typing spacefic word in this textbox and PRESS ENTER THEN FORM2.show
in vb6
i can do this
if keyascii = 13 then
form2.show
end if
how can i do this in vb2005
that's urgent plz
thanks
|
|
|
|
|
If (e.KeyCode = Keys.Enter) Then
End If
|
|
|
|