|
brajoez wrote: this is africa.
Your profile states USA .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[Image resize DLL]
|
|
|
|
|
|
brajoez wrote: my vhost
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi everybody.
Can anyone please help? i have the following problem:
as per title, i need to add a code module to the active vb project at runtime, like i know and i have experimented is possible from the Vbe object in vba.
Please see this article to understand what i mean:
http://www.cpearson.com/excel/vbe.aspx
So, to come to the point, i have added a reference to 'microsoft visual basic 6.0 extensibility' in my project references, then i have added this testing code to a form:
Private Sub Form_Click()<br />
Set x = VBIDE.VBE<br />
s = x.ActiveVBProject.Name<br />
End Sub
but it throws an error at runtime ('method or data member not found').
i think the reason for this error is that the VbIDE.Vbe object only refers to the vba IDE (the one you see built in msoffice applications), not the vb6 IDE i am working in. i need to first get a reference to my project, to be able to add a code module to it at runtime!
i have also tried to set a reference to 'microsoft development environment 6.0' in my project, to use DTE.projects property, but still no luck.
can anyone help? it's driving me mad...
thank you very much in advance
ps: why do i want that feature to work? because i need to add a control to a form without any previous knowledge of what type of control it will be. E.g. (roughly describing the situation) i have a textbox and a command button on the form and must add to the form the type of control the user enters in the textbox text.
|
|
|
|
|
Why not have a dropdown of the controls your willing to add to the screen and have predefined routines that are coded to add each type to the form? You have know something about the control otherwise it will just be "dead" on the form (no events).
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
|
|
|
|
|
that's exactly what i want to avoid.
let's say the matter is a bit more complicated in fact.
first of all, i have explained myself at least very badly. if i'd just like to add to the form a control which type i don't know (for it must be entered by the user) then i'd only need to write code like the following (never mind the new control's events-management with event handlers, for now -- like you said the controls will be dead on the form):
<br />
Dim x As Object<br />
Set x = Me.Controls.Add(textbox.text, "Button1")<br />
x.Visible = True<br /> ,
leaving to the user the responsibility to fill textbox.text with the correct object-identifier string -- in this case textbox.text should be "Vb.CommandButton"
but the fact is i want a function (called SetObjectProperty) to set, of a specified object, a property i don't know. To be more clear, the arguments of the function must be:
SetObjectProperty(Control as string, Property as string, Value as variant).
let's suppose the user doesn't worry about passing the Control argument to the function (he only wants new command buttons to be created on the form): but the user wants to set a property for that object! he wants the property indicated in the Property argument to be changed, for the new command button, to Value. so, let's also suppose, to simplify things, he enters in a textbox1 a string representing the property of the command button he intends to change, while in a textbox2 a string representing the new value of that property: well to handle this i can't have code such as for example
<br />
<br />
Dim x As CommandButton<br />
Set x = Me.Controls.Add("Vb.CommandButton", "Button1")<br />
x.(textbox1.text)= textbox2.text '<-- that's wrong<br />
<br />
i can't do unless i add some code to the project at runtime (it is the only way i can imagine; if other exist to access a property of a control, please tell me)
and since i am writing an activex dll, writing a pair of property get/let procedures (for each property of each new control i let te user create on the form) would be frustrating, and moreover would sensibly reduce code-processing speed and efficiency.
modified on Tuesday, August 19, 2008 2:23 AM
|
|
|
|
|
i answer to myself. it's pretty sad, but...
about setting a property one doesn't know, in vb6 there is the callbyname function (search the msdn guide or refer to this article.
in vb .net one should use the setproperty function.
about adding code modules at runtime, which is my problem, i still have not found a solution, but if there is a method in vba, why shouldn't there be one for vb6?
thank you the same
|
|
|
|
|
Hello!
In a website, a result database is accessed only by ID of the students. Is there any way to make a loop on that control(a textbox and a submit button) to put numbers(ID of student) in the textbox and retrieve the information i.e. result?
|
|
|
|
|
I might not know what you're asking, but if it's in a website you might want to try the ASP.NET forum.
|
|
|
|
|
Of course.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Christian you are an evil bastard but I think you were too verbose - Yes would have done
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I honestly answered his question as best I could with the info provided. If he provided some more info, I could be more specific.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
damn. u people can actually code. respek :P
|
|
|
|
|
Muhahahaa...............the evilness runs deep here.
|
|
|
|
|
Hi
I am working on vb2005 .In my require ,I need to handle mouseclick
and mousedoubleclick events .I tried to use those event ,but for both single and double click only mouseclick event is raising. So ,how could I handle both the situations?
Please help me out in solving my issue..
Thanks
Chaitanya
|
|
|
|
|
aaaa. i cant remember too well, but there is a double click event for what u looking for in vb.net and i found it last time doing a simple google for "vb" double click event... soz mate
|
|
|
|
|
Thanks Brajoez..
But I need to handle both the click and doubleclick events at a time .
For me, when I click once, it is raising click event and same for doubleclick too..
I want to differentiate both..
|
|
|
|
|
hi everyone
i have one Masked Text Box it is taking this Format 00/0/0
it is not a Date but it is same format that mean the user can enter
10/1/5
88/4/8
05/0/4
any thing like that but here is my problem i want the user to enter the digit from right to left not the text box it self but the text it self i mean
if my the number that will be enter is 10/1/2
i want when the user start he will put 2 then 1 then 10
so it will be like this
10/1/2
i know my question is little bit difficult but please my whole project depend on this
|
|
|
|
|
I'm not 100% sure what you want from your question.........., but if you want the user input to be in the opposite direction - why not reverse the mask on the masked edit textbox?
Behind the scenes, you can flip the string however you want for processing (using something like strreverse or whatever means you deem necessary).
From a user interface standpoint, I think it would be confusing if the masked was displayed as 00/0/0, but you *really* want the data entered in 0/0/00.
|
|
|
|
|
actually this is what my client want
he already have big archive and the files are organized from
01/1/1
02/1/1
03/1/1
...
...
10/1/1
...
01/2/1
02/2/1
and you know what is main problem that i am using Arabic Language which start from right to left not like others languages(Left to Right)
and he is a little bit laymen in computer so it is not good to let him entering the data in Descending order
so ok i am not making any sense but i need a solution for that
|
|
|
|
|
Ok - that makes sense. Generally on the text boxes you can toggle the right to left property which forces the typed text in reverse order; but that doesn't appear to work correctly. You could check an extended masked text box that someone has written already like: http://69.10.233.10/KB/cpp/cpflexmaskeditbox.aspx to see if it works.
If not, you can always just extended the regular textbox to your needs.
|
|
|
|
|
My macros stopped working. At work our my docs are located on a network drive. This drive failed and my macro files all had a size of 0.
I copied the macros folder from another dev machine back into my docs (on the newly replaced network drive). The typical default Samples are now displayed. Recording new macros appears to work fine. I can see the temp macros in the macro explorer window. I can press Edit and see the code which also appears to look correct.
When attempting to run any macro, VS just doesn't do anything. It doesn't run the macro, it doesn't display an error or anything.
Anyone run into this before? Any idea how to reset the macros to work properly?
|
|
|
|
|
Got this working again................
|
|
|
|
|
Hi
I have the following script
Dim DStartR As String
Dim DStartC As String
Dim DEndR As String
Dim DEndC As String
Dim StartLocation As String
Dim EndLocation As String
Worksheets(SetMonth).Range("D5").Select
DStartR = "=Cell(""row"",RC)" 'ROW ADDRESS OF D5
DStartC = "=Cell(""row"",R[-1]C)" 'COLUMN ADDRESS OF D5
Worksheets(SetMonth).Range("E5").Select
DEndR = "=Cell(""row"",RC)" 'ROW ADDRESS OF
DEndC = "=Cell(""row"",R[-1]C)"
How do I combine the variables DStartR and DStartC to give me a variable called StartLocation and variables DEndR and DEndC to give me a variable called EndLocation
I then need to generate a calculation using these points which will update as their contents change.
I was using a For LOOP to generate a Variable called DTOTAL, however once the script had finished, it wouldn't update when D5/E5 changed, as a result I need to generate a sum at a location that could potential change based on various generated information.
ie run1 of the script could put DTOTAL at cell reference A22, however run2 of the script could put DTOTAL at cell reference A23 etc.
as a result I need to use the following line of code I think
ActiveCell.Value = "=sum(" & StartLocation &":" & EndLocation &)"
I am unable to check the above as I cant' figure out how to generate StartLocation and EndLocation
I am going to carry on trying to figure out how to do what I need to do, however if some1 can give me a heads up, it would be appreciated
Thanks In Advance
|
|
|
|
|
I tried to Google this but I dont really know what I am trying to ask I guess.
How can I emulate what the SqlCommandType property does with regard to the 3 choice list? You can only choose Text, Stored Procedure and TableDirect. I have the need to do the same thing.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|