|
Windows XP doesn't have the framework by default. Allegedly it will find its way into an upcoming service pack. Not sure about 2003 though, you may be right.
|
|
|
|
|
Hello all
I want to write a VB Macro that will forward a message that I have selected. For all intent and purposes I am trying to emulate the Forward button.
I know that if I code this
Set myForward = myFolder.Items(1).Forward
Then it will forward the first message in my inbox (assumign that my inbox is the folder that it has been sent to)
Is there a way to change it so that it forwards the messge I select, and not simply the first message. I'm confused as how to get the selection?
Anybody know anything abotu VBA and outlook?
thanks
Nick
|
|
|
|
|
I'm c++ programmer..
How to convert the following C++ code to VB?
<br />
c++<br />
<br />
char str1[1024];<br />
<br />
ifstream fin("c:\\file1.txt",ios::in);<br />
ofstream fout("c:\\file2.txt",ios::out);<br />
<br />
while (!fin.eof())<br />
{<br />
fin.getline(str1,1024,'|');
str1[strlen(str1)] = NULL; <br />
fout<<str1<<endl;
}<br />
fin.close();<br />
fout.close();<br />
the following code is a basic I/O file in C++. I wanna know the basic read write to file in VB..
I found something but kind of confused me..
Could you explain how..
thanks
|
|
|
|
|
well you could write to a file / create and write in vb.net like this...
VbCode:
<font color="blue">Private</font> <font color="blue">Sub</font> Button1_Click(<font color="blue">ByVal</font> sender <font color="blue">As</font> System.Object, <font color="blue">ByVal</font> e <font color="blue">As</font> System.EventArgs) <font color="blue">Handles</font> Button1.Click <br> <font color="blue">Dim</font> writer <font color="blue">As</font> IO.StreamWriter = <font color="blue">New</font> IO.StreamWriter(<font color="blue">New</font> IO.FileStream("D:\my.html", IO.FileMode.OpenOrCreate)) <br> writer.Write(RichTextBox1.Text) <br> writer.Close() <br> Process.Start("D:\my.html") <br> <font color="blue">End</font> <font color="blue">Sub</font> <br>
or to read / still be able to write ....
VbCode:
<font color="blue">Private</font> <font color="blue">Sub</font> Button2_Click(<font color="blue">ByVal</font> sender <font color="blue">As</font> System.Object, <font color="blue">ByVal</font> e <font color="blue">As</font> System.EventArgs) <font color="blue">Handles</font> Button2.Click <br> <font color="blue">Dim</font> reader <font color="blue">As</font> <font color="blue">New</font> IO.StreamReader(<font color="blue">New</font> IO.FileStream("D:\my.html", IO.FileMode.OpenOrCreate, IO.FileAccess.ReadWrite)) <br> <font color="#0000FF">While Not</font> reader.Peek <br> RichTextBox1.AppendText(reader.ReadLine & Environment.NewLine) <br> <font color="blue">End</font> <font color="#0000FF">While</font> <br> reader.Close() <br> <font color="blue">End</font> <font color="blue">Sub</font> <br>
hope it helps
Vb:
<font color="blue">Public Function</font> TwinsOnWay(<font color="blue">ByVal</font> twins <font color="blue">As String</font>) <font color="blue">As String <br> Select Case</font> twins<br> <font color="blue">Case</font> "Gender" <br> <font color="blue">Return</font> "Two Girls" <br> <font color="blue">End Select <br> End Function</font> <br>
|
|
|
|
|
When running our project, a login screen pops up before the system can be used. We want to assign the <enter> key to the OK button, and the escape key to the Cancel button.
Where and how do we set this at design time or programmatically?
|
|
|
|
|
for VB6 :
set the OK Button property(default) to True to make Enter the default..
and for Cancel Button set (cancel) to true..
VB.NET:
in the form assign the defult button property the name of the OK Button..
|
|
|
|
|
Thanx for the help, but unfortunately I am still a beginner in VB.NET! What is the code to set the default property?
|
|
|
|
|
Be careful how you use the terminology. There is no such thing as a "Default Property" in the .NET Framework.
What you are looking for is in the Form Properties. Click on the Form you are using to get the UserName and Password. Under the Misc section in the Properties window you will find AcceptButton and CancelButton. You can assign which button does what and the form will automatically process the ENTER and ESC keys as Accept/OK and Cancel.
Now, to get the OK button to LOOK like a Default button you have to call the NotifyDefault method on the button, probably in the Form's Load event, like this:
Private Sub AuthForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
OKButton.NotifyDefault(True)
End Sub
This will force the button to draw itself with the thicker border of the default button.
RageInTheMachine9532
|
|
|
|
|
We get the following error when we create a new child on our MDI Parent:
An unhandled exception of type 'System.OutOfMemoryException' occurred in system.windows.forms.dll<br />
<br />
Additional information: Error creating window handle.
The Code:
Dim frmChild As Form = New frmAffiliationRegistration()<br />
<br />
Private Sub MenuItem12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem12.Click<br />
<br />
<br />
frmChild.Dispose()<br />
frmChild = New frmAdjudicatorRegistration()<br />
frmChild.MdiParent = Me<br />
frmChild.Enabled = True<br />
frmChild.Show()<br />
End Sub
Any advice?
|
|
|
|
|
Heya
Change your Dim line to this:
Dim frmChild As New frmAffiliationRegistration()
And take the first two lines out of the next block. You only need these three:
frmChild.MdiParent = Me
frmChild.Enabled = True
frmChild.Show()
Beware the chickens, for in their silence, they plot...
Life is too short to be taken seriously.
-- Oscar Wilde
|
|
|
|
|
Dim frmChild As Form = New frmAffiliationRegistration()
Private Sub MenuItem12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem12.Click
frmChild.Dispose()
frmChild= Nothing
frmChild = New frmAdjudicatorRegistration()
frmChild.MdiParent = Me
frmChild.Enabled = True
frmChild.Show()
End Sub
'Is it Working???
|
|
|
|
|
What is the best way to backup a database used in a project to a CD-Writable? We want to put in an option in our VB.NET program to burn the database on a CD.
|
|
|
|
|
Emile Jacobs wrote:
What is the best way to backup a database used in a project to a CD-Writable? We want to put in an option in our VB.NET program to burn the database on a CD.
If you are using only Windows XP based machines, you can use IMAPI, which is a very easy way for VB programmers, because it's avaliable as a bunch of COM components.
But if you want broader OS scope, you'll need to use Nero's APIs.
while (!sorted)
;
|
|
|
|
|
How does one declare a variable that is available for any form in the project?
|
|
|
|
|
Emile Jacobs wrote:
How does one declare a variable that is available for any form in the project?
Declare a shared public variable in your class, access this variable via MyClassName.MyVariableName.
Click here to see my articles and software tools
|
|
|
|
|
We created a shared variable in the class, but we do not know how to declare the class in the different forms!
|
|
|
|
|
The class has to be in the same the project, you don't need to declare it. If the class is only visible in a different name space, then you need to access it via MyNameSpace.MyClassName.MyVariableName.
If multiple threads are accessing this variable, make sure thread-safety.
Click here to see my articles and software tools
|
|
|
|
|
Thanx for the great advice! Everything works perfectly!
|
|
|
|
|
Add a new module, such as modMain.vb and in there declare a variable as Public, i.e:
Public iMyGlobalVariable as Integer
This will give it a global scope.
|
|
|
|
|
create a new class called GlobalVariables or what ever you like
Then put the variables that you would like to call
this is C# code
I created a new Class called GlobalVariables.cs
on that page the only code that I have is
public class GlobalVariables
{
public string ReportSection = "";
public GlobalVariables()
{
}
}
just because I didnt heed it to do anything else.
Now on any page that I like I can do this:
create an instance of that class
GlobalVariables MyVariables = new GlobalVariables();
now assign the values
MyVariables.ReportSection = "";
that should do it,
William O'Malley
|
|
|
|
|
I created a Form having controls more than 500(say) in a Panel all are having anchors set(incl. Panel). When I try to Resize the Form, It takes too much of time to get refreshed. The Form get dull and sluggy for few seconds. Is there anyway by which I kan write a code after resizing event of form gets over? Or boost up the speed of Resizing event. Anchoring is not the solution @ all . Moreover, when I give "Panel1.Controls.Clear", It takes 2 much time to Clear all the Controls from The Panel.
Plz HELP........
RAVI.
|
|
|
|
|
First of all, why would you want to have 500 controls on a form???
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
RAVI143 wrote:
I created a Form having controls more than 500(say) in a Panel
How do you fit everthing inside?? My suggestion is, if it's not all visible at one time, try to add controls dynamically instead of having all the controls at the same time.
Nick Seng (the programmer formerly known as Notorious SMC)
God, I pity me! - Phoncible P. Bone
|
|
|
|
|
500 CONTROLS?!
I'd look at that and close the window immediately and the entire app shortly thereafter and write it off as being way to convoluted. How about breaking some of that up into multiple forms.
Coding for every one of these must be a real pain? Even to just get values!
RageInTheMachine9532
|
|
|
|
|
Hello,
I have three forms: frmCustomerTemplate, frmAddCustomer, and frmUpdateCustomer.
frmAddCustomer derives from frmCustomerTemplate, and frmUpdateCustomer derives from frmAddCustomer.
Diagram:
frmCustomerTemplate --> frmAddCustomer --> frmUpdateCustomer
I'm encoutering a problem where frmUpdateCustomer is not getting values from the fields that were defined on frmCustomerTemplate. For example, frmAddCustomer defines a Home Telephone textbox that was not declared on frmCustomerTemplate. When I do an update (using frmUpdateCustomer) I can only get the value from the Home Telephone textbox. All the other fields populate my variables with nulls, even though they are populated. All the controls on frmCustomerTemplate are declared as Protected.
Any ideas why this is happening?
Thanks,
Andrew
|
|
|
|